0

I have a smart capture form that is capturing data for a competition we are holding. When the user submits the form it redirects to another cloudpage which has a little thank you message.

On this thank you page I have a link that says 'VISIT WEBSITE'. Because we have a global website, I'd like this link to be dynamic based on what the Country the user enters on the previous pages smart capture form.

Is this possible?

The Ampscript I would normally use is:

%%[SET @Region = "%%=Lookup('CloudPages_DataExtension','Country','EmailAddress',EmailAddress)=%%" 

Based on the value that returns I set all of the other variables, But this isn't working. I assume its because the data doesn't flow through to the data extension fast enough to be referenced. or it doesn't keep the email address entered from the previous page stored anywhere.

Any help to get around this would be greatly appreciated!

Cheers!


UPDATE 30/01

Thanks Vishal! I have been doing some more research and wondering if the easier method is to have the AMPscript written like this on my thank you page:

%%[SET @Region = "RequestParameter("Country")" 

@2XUBaseURL IF @Region == "United States"
THEN SET @2XUBaseURL = "https://www.website.com/us" 
ELSEIF 
@Region == "United Kingdom"
THEN SET @2XUBaseURL = "https://www.website.com/uk" 
ELSEIF 
@Region == "Sweden"
THEN SET @2XUBaseURL = "https://www.website.com/se" 
ELSEIF 
@Region == "New Zealand"
THEN SET @2XUBaseURL = "https://www.website.com/au" 
ELSEIF 
@Region == "Norway"
THEN SET @2XUBaseURL = "https://www.website.com/no" 
ELSEIF 
@Region == "Japan"
THEN SET @2XUBaseURL = "https://www.website.com/jp" 
ELSEIF 
@Region == "Finland"
THEN SET @2XUBaseURL = "https://www.website.com/fi" 
ELSEIF 
@Region == "Denmark"
THEN SET @2XUBaseURL = "https://www.website.com/dk" 
ELSEIF 
@Region == "Canada"
THEN SET @2XUBaseURL = "https://www.website.com/ca" 
ELSEIF 
@Region == "Australia"
THEN SET @2XUBaseURL = "https://www.website.com/au" 

ELSE SET @2XUBaseURL = "https://www.website.com/us" 

ENDIF ]%%

and on the redirect link from the entry page to have the URL set as:

%%=RedirectTo(CloudPagesURL(ID, 'Country', @Country))=%%

Will this work?

0

I would take this approach.

Step 01: Create a Non-sendable DE with respective country URLs as below. enter image description here

Step 02: Place the below AMPscript in your Thank you page.

%%[
    SET @country = RequestParameter("country")
    SET @URL  = Lookup("StackEX_demo_2020JAN29","URL","Country", @country)
]%%

    Dynamic URL = <a href="%%=RedirectTo(@URL)=%%" target="_blank">VISIT WEBSITE</a>

Note:
1)You can bring in all your Form fields to this page by using RequestParameter() method.
2) Change DE name within AMPscript
3) Update additional DE fields if required.
4) You can send additional parameters in your URL using Concat() method, if required.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.