AmpScript link not working without RedirectTo, and RedirectTo breaks the link
Clash Royale CLAN TAG#URR8PPP
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)
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
add a comment |
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)
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
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
add a comment |
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)
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
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)
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
marketing-cloud ampscript
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
2 things to try:
- Make sure to add an alias to the tag -
<a href="" alias="CalendarInvite">
. - Try using the WrapLongURL() AMPscript function around it.
<a href="%%=RedirectTo(WrapLongURL(@calendareInviteURL))=%%" alias="CalendarInvite">
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
2 things to try:
- Make sure to add an alias to the tag -
<a href="" alias="CalendarInvite">
. - Try using the WrapLongURL() AMPscript function around it.
<a href="%%=RedirectTo(WrapLongURL(@calendareInviteURL))=%%" alias="CalendarInvite">
add a comment |
2 things to try:
- Make sure to add an alias to the tag -
<a href="" alias="CalendarInvite">
. - Try using the WrapLongURL() AMPscript function around it.
<a href="%%=RedirectTo(WrapLongURL(@calendareInviteURL))=%%" alias="CalendarInvite">
add a comment |
2 things to try:
- Make sure to add an alias to the tag -
<a href="" alias="CalendarInvite">
. - Try using the WrapLongURL() AMPscript function around it.
<a href="%%=RedirectTo(WrapLongURL(@calendareInviteURL))=%%" alias="CalendarInvite">
2 things to try:
- Make sure to add an alias to the tag -
<a href="" alias="CalendarInvite">
. - Try using the WrapLongURL() AMPscript function around it.
<a href="%%=RedirectTo(WrapLongURL(@calendareInviteURL))=%%" alias="CalendarInvite">
answered Feb 7 at 16:59
GortoningtonGortonington
11.1k1129
11.1k1129
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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