0

I'm trying to pass a language variable from one cloudpage to another.
For context, once i get the variable to pass, I will then do a lookup based on language variable to lookup multi-language translations from a data extension in order for the pages to resolve in language.

1st cloudpage = form
2nd cloudpage = handler
3rd cloudpage = opt-out confirmation text

1st cloudpage

I can pass ?lang=fr and it passes the language. It works for the recaptcha page link that is on the 1st cloudpage (form).

What it doesn't do is pass it to the 2nd cloudpage, cloudpage where I have this "https://frefef.pub.sfmc-content.com/2uopfyi2x0ra3?%%=v(@lang)=%%"

2nd cloudpage (handler)

I added this to the hander but its not working either. SET @lang = RequestParameter("lang") Redirect("https://frefef.sfmc-content.com/xvk53leo4qh?%%=v(@lang)=%%")

3rd cloudpage

I have the same code but the querystring doesn't seem to pass. I'm guessing its not passing from the 1st page.

1st cloudpage (form) code

    %%[
  
  SET @lang = RequestParameter("lang")
  
  ]%%
<head>
    <script src="https://www.google.com/recaptcha/api.js?hl=%%=v(@lang)=%%"></script>
</head>

<body>
    <form id="form" action="https://frefef.pub.sfmc-content.com/2uopfyi2x0ra3?%%=v(@lang)=%%" method="post">


1 Answer 1

1

It seems you’re passing https://frefef.sfmc-content.com/xvk53leo4qh?%%=v(@lang)=%% which would resolve to eg. https://frefef.sfmc-content.com/xvk53leo4qh?fr

So try adding the actual qs part:

https://frefef.sfmc-content.com/xvk53leo4qh?lang=%%=v(@lang)=%%

Also I would do a concat first and use the url variable as the link:

Set @url = concat("https://frefef.sfmc-content.com/xvk53leo4qh?lang=", @lang)

As a third option, since it’s a form, you can add the language as a hiddden form field and it will work as well:

<input name="lang" type="hidden" value="%%=v(@lang)=%%">
1
  • Thank you. I used concat on the 1st and 2nd pages and it resolves on the 3rd. Will also give type = "hidden" a try.
    – lyslexic
    Mar 23 at 13:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .