0

I've been trying to figure out how to work with passing URL parameters when using CONCAT(CloudPagesURL(XX),"&=sk",@subscriberKey") and also CONCAT(CONCAT(CloudPagesURL(XX),"&=sk"),@subscriberKey").

I've even tried working with http://www.google.com?sk=@subscriberKey and http://www.google.com?sk=%%=v(@subscriberKey)==%

however, it appears that because when using redirect, the URL is shown inside "" and since it's already within the ampscript code section is doesn't evaluate ampscript variables inside "".

Even breaking it up into:

@URL = http://www.google.com?sk=
@variable = @subscriberKey
@finalURL = CONCAT(@url, @variable)
Redirect(@finalURL)

didn't work.

Have anybody else experienced this? and know of a workaround?

2

2 Answers 2

2

Lots of ways to achieve this -

Example:1 You can use CloudPagesURL & Redirect AmpScript function and pass the additional parameter inside the CloudPagesURL.

%%[
SET @SubscriberKey = "[email protected]"
    IF Not Empty(@SubscriberKey) Then
       Redirect(CloudPagesURL(PassCloudPageID,"sk", @SubscriberKey))
    EndIF
]%%

Example:2 You can use Redirect & Concat AmpScript function to add the additional parameter in URL.

%%[
SET @SubscriberKey = "[email protected]"
    IF Not Empty(@SubscriberKey) Then
       Redirect(ConCat('http://www.google.com&sk=',@SubscriberKey))
    EndIF
]%%
2
  • Hi Palash - the first example might just do it. Have you tested the second One before ? Because that crashed the site when i tried. Commented Feb 16, 2017 at 14:59
  • Yeah, I used many times and just now cross checked; its working like a champ!
    – Palash Rai
    Commented Feb 16, 2017 at 16:24
3

I'm using Concat and RedirectTo for creating links in AMPscript and for me the following code works (Hostname, somevar and paramvalue are read from dataextensions (code not included in my example)):

%%[
    Set @link = Concat('https://', @Hostname, '/', LowerCase(@somevar) ,'/some/string/and?param=', @paramvalue)
]%%

<a href="%%=RedirectTo(@link)=%%">%%=v(@link)=%%</a>
2
  • Yeah, but redirectTo is designed for emails and works upon clicking. Redirect is for CloudPages and redirects the browser :) Commented Feb 16, 2017 at 11:16
  • @KennethWagner Sorry, I read over that detail ;) Commented Feb 16, 2017 at 12:45

You must log in to answer this question.

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