1

We have a question regarding the query string applied to URLs in our emails:

We noticed that we run into some issues when our custom tracking codes get applied to destination URLs other than own domains (ex.: links to Youtube or Twitter) since our query string sometimes contain pipes ("|"), which these sites don’t accept. To avoid having broken links, and since these custom tracking codes are not necessary on third party links, we would need the script that generates the query string to be edited so it only applies it to Cirque’s URLs.

So basically, adding a condition that says if destination URL contains "testdomain.com" OR "fakedomain.com" OR "anotherfakedomain.com", then apply the query string. Else, do nothing.

It’s important for the condition to be “contains” and not “equals”, since we do have subdomains like “tickets.fakedomain.com” and we need to make sure the tracking code also get applied to those.

1

You will want to use an AMPscript block, something like this:

 %%[
        SET @qs = "value|With|pipes"
        SET @URL = "WhateverMechanismYouUseToSetThis"

        IF INDEXOF(@URL, "testdomain.com") > 0 OR INDEXOF(@URL, "fakedomain.com") > 0 OR .... THEN

             SET @URL = Concat(@URL, @qs)
        ENDIF
        /* no need to do anything for else case */

  ]%%

Hope this helps!

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.