AmpScript link not working without RedirectTo, and RedirectTo breaks the link

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












1















I have a very complex link. It's a Google Calendar Link so it's very long and has all kinds of characters. (see image)



enter image description here



The link works fine when clicked directly and even works in the SFMC UI. It breaks once it gets to the email and the issue seems to be that RedirectTo is breaking it. It's replacing the ? with &. So I tried it without RedirectTo and the link doesn't work at all. Which is odd, because I've had times with not using RedirectTo works fine, and other times when it doesn't. And I've heawrd it's best practice to use it. I also know you can't track clicks without it, but we don't need to track clicks so that's not an issue. I just need to get this link to work. Anyone had a similar issue like this?



The really, really strange thing is that the MSO version of the link works



So the top one works, the bottom one doesn't:



<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="%%=RedirectTo(@calendarInviteURL)=%%" style="height:40px;v-text-anchor:middle;width:180px;" arcsize="15%" stroke="f" fillcolor="#052E60">
<w:anchorlock/>
<center>
<![endif]-->


<a href="%%=RedirectTo(@calendarInviteURL)=%%" style="background-color:#052E60;border-radius:5px;color:#ffffff;display:inline-block;font-family:arial,sans-serif;font-size:12px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:180px;-webkit-text-size-adjust:none;">ADD TO CALENDAR</a>









share|improve this question






















  • Ok I found at least one issue and that is why the link wasn't working without RedirectTo. I was using preview and test and I need to uncheck track links, then the links work without RedirectTo, but still not sure why RedirectTo breaks it in the first place...

    – garek007
    Feb 7 at 15:53











  • And unfortunately I need to track other links in the email... We are using a triggered send, so I can turn this off in the triggered send, but none of the links will track then, and we can't have that. The issue seems to be when "Track Links" is turned on, then %%=v(@calendarInviteLink)=%% gets concatenated as click.mail.salesforce.com/%%=v(@calendarInviteURL)=%% and that's a bad link

    – garek007
    Feb 7 at 15:58







  • 1





    2 things to try: 1. Make sure to add an alias to the <a> tag - <a href="" alias="CalendarInvite">. 2. Try using the WrapLongURL() AMPscript function around it. RedirectTo(WrapLongURL(@calendareInviteURL)) (developer.salesforce.com/docs/…)

    – Gortonington
    Feb 7 at 16:03






  • 2





    OMG WrapLongURL worked!!!! I read up on that and I didn't think it would work so I didn't try. I'm glad you suggested it! I tried URLEncode() and that didn't work either. This is great! Thank YOU! Post it if you want and I'll mark it.

    – garek007
    Feb 7 at 16:32
















1















I have a very complex link. It's a Google Calendar Link so it's very long and has all kinds of characters. (see image)



enter image description here



The link works fine when clicked directly and even works in the SFMC UI. It breaks once it gets to the email and the issue seems to be that RedirectTo is breaking it. It's replacing the ? with &. So I tried it without RedirectTo and the link doesn't work at all. Which is odd, because I've had times with not using RedirectTo works fine, and other times when it doesn't. And I've heawrd it's best practice to use it. I also know you can't track clicks without it, but we don't need to track clicks so that's not an issue. I just need to get this link to work. Anyone had a similar issue like this?



The really, really strange thing is that the MSO version of the link works



So the top one works, the bottom one doesn't:



<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="%%=RedirectTo(@calendarInviteURL)=%%" style="height:40px;v-text-anchor:middle;width:180px;" arcsize="15%" stroke="f" fillcolor="#052E60">
<w:anchorlock/>
<center>
<![endif]-->


<a href="%%=RedirectTo(@calendarInviteURL)=%%" style="background-color:#052E60;border-radius:5px;color:#ffffff;display:inline-block;font-family:arial,sans-serif;font-size:12px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:180px;-webkit-text-size-adjust:none;">ADD TO CALENDAR</a>









share|improve this question






















  • Ok I found at least one issue and that is why the link wasn't working without RedirectTo. I was using preview and test and I need to uncheck track links, then the links work without RedirectTo, but still not sure why RedirectTo breaks it in the first place...

    – garek007
    Feb 7 at 15:53











  • And unfortunately I need to track other links in the email... We are using a triggered send, so I can turn this off in the triggered send, but none of the links will track then, and we can't have that. The issue seems to be when "Track Links" is turned on, then %%=v(@calendarInviteLink)=%% gets concatenated as click.mail.salesforce.com/%%=v(@calendarInviteURL)=%% and that's a bad link

    – garek007
    Feb 7 at 15:58







  • 1





    2 things to try: 1. Make sure to add an alias to the <a> tag - <a href="" alias="CalendarInvite">. 2. Try using the WrapLongURL() AMPscript function around it. RedirectTo(WrapLongURL(@calendareInviteURL)) (developer.salesforce.com/docs/…)

    – Gortonington
    Feb 7 at 16:03






  • 2





    OMG WrapLongURL worked!!!! I read up on that and I didn't think it would work so I didn't try. I'm glad you suggested it! I tried URLEncode() and that didn't work either. This is great! Thank YOU! Post it if you want and I'll mark it.

    – garek007
    Feb 7 at 16:32














1












1








1


1






I have a very complex link. It's a Google Calendar Link so it's very long and has all kinds of characters. (see image)



enter image description here



The link works fine when clicked directly and even works in the SFMC UI. It breaks once it gets to the email and the issue seems to be that RedirectTo is breaking it. It's replacing the ? with &. So I tried it without RedirectTo and the link doesn't work at all. Which is odd, because I've had times with not using RedirectTo works fine, and other times when it doesn't. And I've heawrd it's best practice to use it. I also know you can't track clicks without it, but we don't need to track clicks so that's not an issue. I just need to get this link to work. Anyone had a similar issue like this?



The really, really strange thing is that the MSO version of the link works



So the top one works, the bottom one doesn't:



<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="%%=RedirectTo(@calendarInviteURL)=%%" style="height:40px;v-text-anchor:middle;width:180px;" arcsize="15%" stroke="f" fillcolor="#052E60">
<w:anchorlock/>
<center>
<![endif]-->


<a href="%%=RedirectTo(@calendarInviteURL)=%%" style="background-color:#052E60;border-radius:5px;color:#ffffff;display:inline-block;font-family:arial,sans-serif;font-size:12px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:180px;-webkit-text-size-adjust:none;">ADD TO CALENDAR</a>









share|improve this question














I have a very complex link. It's a Google Calendar Link so it's very long and has all kinds of characters. (see image)



enter image description here



The link works fine when clicked directly and even works in the SFMC UI. It breaks once it gets to the email and the issue seems to be that RedirectTo is breaking it. It's replacing the ? with &. So I tried it without RedirectTo and the link doesn't work at all. Which is odd, because I've had times with not using RedirectTo works fine, and other times when it doesn't. And I've heawrd it's best practice to use it. I also know you can't track clicks without it, but we don't need to track clicks so that's not an issue. I just need to get this link to work. Anyone had a similar issue like this?



The really, really strange thing is that the MSO version of the link works



So the top one works, the bottom one doesn't:



<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="%%=RedirectTo(@calendarInviteURL)=%%" style="height:40px;v-text-anchor:middle;width:180px;" arcsize="15%" stroke="f" fillcolor="#052E60">
<w:anchorlock/>
<center>
<![endif]-->


<a href="%%=RedirectTo(@calendarInviteURL)=%%" style="background-color:#052E60;border-radius:5px;color:#ffffff;display:inline-block;font-family:arial,sans-serif;font-size:12px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:180px;-webkit-text-size-adjust:none;">ADD TO CALENDAR</a>






marketing-cloud ampscript






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 7 at 15:46









garek007garek007

290112




290112












  • Ok I found at least one issue and that is why the link wasn't working without RedirectTo. I was using preview and test and I need to uncheck track links, then the links work without RedirectTo, but still not sure why RedirectTo breaks it in the first place...

    – garek007
    Feb 7 at 15:53











  • And unfortunately I need to track other links in the email... We are using a triggered send, so I can turn this off in the triggered send, but none of the links will track then, and we can't have that. The issue seems to be when "Track Links" is turned on, then %%=v(@calendarInviteLink)=%% gets concatenated as click.mail.salesforce.com/%%=v(@calendarInviteURL)=%% and that's a bad link

    – garek007
    Feb 7 at 15:58







  • 1





    2 things to try: 1. Make sure to add an alias to the <a> tag - <a href="" alias="CalendarInvite">. 2. Try using the WrapLongURL() AMPscript function around it. RedirectTo(WrapLongURL(@calendareInviteURL)) (developer.salesforce.com/docs/…)

    – Gortonington
    Feb 7 at 16:03






  • 2





    OMG WrapLongURL worked!!!! I read up on that and I didn't think it would work so I didn't try. I'm glad you suggested it! I tried URLEncode() and that didn't work either. This is great! Thank YOU! Post it if you want and I'll mark it.

    – garek007
    Feb 7 at 16:32


















  • Ok I found at least one issue and that is why the link wasn't working without RedirectTo. I was using preview and test and I need to uncheck track links, then the links work without RedirectTo, but still not sure why RedirectTo breaks it in the first place...

    – garek007
    Feb 7 at 15:53











  • And unfortunately I need to track other links in the email... We are using a triggered send, so I can turn this off in the triggered send, but none of the links will track then, and we can't have that. The issue seems to be when "Track Links" is turned on, then %%=v(@calendarInviteLink)=%% gets concatenated as click.mail.salesforce.com/%%=v(@calendarInviteURL)=%% and that's a bad link

    – garek007
    Feb 7 at 15:58







  • 1





    2 things to try: 1. Make sure to add an alias to the <a> tag - <a href="" alias="CalendarInvite">. 2. Try using the WrapLongURL() AMPscript function around it. RedirectTo(WrapLongURL(@calendareInviteURL)) (developer.salesforce.com/docs/…)

    – Gortonington
    Feb 7 at 16:03






  • 2





    OMG WrapLongURL worked!!!! I read up on that and I didn't think it would work so I didn't try. I'm glad you suggested it! I tried URLEncode() and that didn't work either. This is great! Thank YOU! Post it if you want and I'll mark it.

    – garek007
    Feb 7 at 16:32

















Ok I found at least one issue and that is why the link wasn't working without RedirectTo. I was using preview and test and I need to uncheck track links, then the links work without RedirectTo, but still not sure why RedirectTo breaks it in the first place...

– garek007
Feb 7 at 15:53





Ok I found at least one issue and that is why the link wasn't working without RedirectTo. I was using preview and test and I need to uncheck track links, then the links work without RedirectTo, but still not sure why RedirectTo breaks it in the first place...

– garek007
Feb 7 at 15:53













And unfortunately I need to track other links in the email... We are using a triggered send, so I can turn this off in the triggered send, but none of the links will track then, and we can't have that. The issue seems to be when "Track Links" is turned on, then %%=v(@calendarInviteLink)=%% gets concatenated as click.mail.salesforce.com/%%=v(@calendarInviteURL)=%% and that's a bad link

– garek007
Feb 7 at 15:58






And unfortunately I need to track other links in the email... We are using a triggered send, so I can turn this off in the triggered send, but none of the links will track then, and we can't have that. The issue seems to be when "Track Links" is turned on, then %%=v(@calendarInviteLink)=%% gets concatenated as click.mail.salesforce.com/%%=v(@calendarInviteURL)=%% and that's a bad link

– garek007
Feb 7 at 15:58





1




1





2 things to try: 1. Make sure to add an alias to the <a> tag - <a href="" alias="CalendarInvite">. 2. Try using the WrapLongURL() AMPscript function around it. RedirectTo(WrapLongURL(@calendareInviteURL)) (developer.salesforce.com/docs/…)

– Gortonington
Feb 7 at 16:03





2 things to try: 1. Make sure to add an alias to the <a> tag - <a href="" alias="CalendarInvite">. 2. Try using the WrapLongURL() AMPscript function around it. RedirectTo(WrapLongURL(@calendareInviteURL)) (developer.salesforce.com/docs/…)

– Gortonington
Feb 7 at 16:03




2




2





OMG WrapLongURL worked!!!! I read up on that and I didn't think it would work so I didn't try. I'm glad you suggested it! I tried URLEncode() and that didn't work either. This is great! Thank YOU! Post it if you want and I'll mark it.

– garek007
Feb 7 at 16:32






OMG WrapLongURL worked!!!! I read up on that and I didn't think it would work so I didn't try. I'm glad you suggested it! I tried URLEncode() and that didn't work either. This is great! Thank YOU! Post it if you want and I'll mark it.

– garek007
Feb 7 at 16:32











1 Answer
1






active

oldest

votes


















3














2 things to try:



  1. Make sure to add an alias to the tag - <a href="" alias="CalendarInvite">.

  2. Try using the WrapLongURL() AMPscript function around it.

<a href="%%=RedirectTo(WrapLongURL(@calendareInviteURL))=%%" alias="CalendarInvite">






share|improve this answer






















    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "459"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f249511%2fampscript-link-not-working-without-redirectto-and-redirectto-breaks-the-link%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    2 things to try:



    1. Make sure to add an alias to the tag - <a href="" alias="CalendarInvite">.

    2. Try using the WrapLongURL() AMPscript function around it.

    <a href="%%=RedirectTo(WrapLongURL(@calendareInviteURL))=%%" alias="CalendarInvite">






    share|improve this answer



























      3














      2 things to try:



      1. Make sure to add an alias to the tag - <a href="" alias="CalendarInvite">.

      2. Try using the WrapLongURL() AMPscript function around it.

      <a href="%%=RedirectTo(WrapLongURL(@calendareInviteURL))=%%" alias="CalendarInvite">






      share|improve this answer

























        3












        3








        3







        2 things to try:



        1. Make sure to add an alias to the tag - <a href="" alias="CalendarInvite">.

        2. Try using the WrapLongURL() AMPscript function around it.

        <a href="%%=RedirectTo(WrapLongURL(@calendareInviteURL))=%%" alias="CalendarInvite">






        share|improve this answer













        2 things to try:



        1. Make sure to add an alias to the tag - <a href="" alias="CalendarInvite">.

        2. Try using the WrapLongURL() AMPscript function around it.

        <a href="%%=RedirectTo(WrapLongURL(@calendareInviteURL))=%%" alias="CalendarInvite">







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 7 at 16:59









        GortoningtonGortonington

        11.1k1129




        11.1k1129



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Salesforce Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f249511%2fampscript-link-not-working-without-redirectto-and-redirectto-breaks-the-link%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown






            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?