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?