We created a custom unsubscribe page for a email template that encodes subscriber information when clicked. The unsub page URL contains a ? - normally, not a problem. However, the account has web analytics connector turned on. Normally also not a problem, as any URL that contains a ? the analytics connector will know to start the string with a & instead. However, the <a href tag in the email template doesn't point a subscriber to the direct URL (due to the subscriber info encoding), but rather the CloudPages URL string. For example: <a href="%%=CloudPagesURL(6)=%%" alias="unsubscribe">.

So, when a subscriber clicks on the Unsubscribe link from an actual email deployment, it redirects to a 500 Error page.

To visualize:

Without the WAC appending to the URL, the URL looks something like this: http://pub.s7.exacttarget.com/example?qs=123456789123456789

With the WAC appending to the URL (causing the 500 error), we see this: http://pub.s7.exacttarget.com/example?qs=123456789123456789**?**cm_mmc=parameter1-_-parameter2-_-parameter3-_-unsubscribe&parameter4=example&et_cid=jobid&et_rid=subscriberkey

You'll notice that after the qs= value there's a second question mark - if we manually change it to an ampersand, it fixes the 500 error and the custom unsub page loads as it should.

So, the question is - how do we fix this to become an ampersand instead of a question mark, as we cannot remove the WAC? Or, is there a workaround solution to this?


Here's another workaround for this bug with the CloudPagesURL() function.

Within the body of the email that drives the subscriber to the CloudPages landing page, create the query string parameter variable.

Then append the CloudPage URL with the parameter and value.

Pass the CloudPageURL variable in the RedirectTo() within the href on the call to action:

%%[/* Script <div style="display:none"> */
VAR @em
SET @em = Base64Encode([emailaddr])
VAR @cloudPageURL
SET @cloudPageURL = Concat('http://pub.s1.exacttarget.com/wargfbdcer3?em=',@em)
/*</div>*/ ]%%

<a href="%%=RedirectTo(@cloudPageURL)=%%">LINK TEXT</a>

Add the following to the CloudPages landing page:

<script type="text/javascript" runat="server">
    Platform.Load("core", "1.1.1");

    var emailAddress = Base64Decode(Request.GetQueryStringParameter("em");

For Reference:



Here's a workaround for this bug with the CloudPagesURL() function. It plays nicely with the Web-Analytics Connector. I forced an extra ? in the URL in the last set @url0 line.

var @pageID, @email, @url
set @pageID = 6
set @email = AttributeValue("emailaddr")
set @url0 = CloudPagesURL(@pageID)
set @url0 = concat(@url0,"?em=",@email,"&whee=whoops")
set @url = ""
set @foundCount = 0

for @i = 1 to length(@url0) do

  set @char = substring(@url0,@i,1)

  if @char == "?" then

    if @foundCount == 1 then
      set @url = concat(@url,"&")
      set @url = concat(@url,@char)

    set @foundCount = add(@foundCount,1)

    set @url = concat(@url,@char)

next @i
<br>@url0: %%=v(@url0)=%%
<br>@url : %%=v(@url)=%%
<h4><a href="%%=redirectto(@url)=%%">link</a></h4>


@url0: http://pub.s1.exacttarget.com/zzzz?qs=yyyy?em=dummy@example.com&whee=whoops 
@url : http://pub.s1.exacttarget.com/zzzz?qs=yyyy&em=dummy@example.com&whee=whoops


Here's a much simpler work-around. It doesn't encrypt the parameters, but that's generally fine since all of the subscribers contextual data is already encrypted:

url: %%=redirectto(concat(CloudPagesURL(6),"&whee=","whoops"))=%%


I believe this is a known bug with the CloudPagesURL function. Instead of using that function, I would simply use the direct URL to the page and pass parameters that will allow you to identify the subscriber until they get it fixed.


FYI, if you have a link that links to a cloud page, you manually can set the html attribute conversion="true" to conversion="false" e.g:

<a alias="unsubscribe" conversion="false" data-linkto="cloudpageslandingpage" href="%%=CloudPagesURL(909)=%%" title="unsubscribe">unsubscribe</a>

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.