This has been killing me all day today. I have an email that has two layers of variables in the AMPscript at the top. First, all of the links are put into variables, like this:

Set @HomePage = Concat('https://www.xxx.htm',@Append2)
Set @ContactUs = Concat('https://www.yyy.htm',@Append2)
Set @Login = Concat('https://www.zzz.htm',@Append2)

Next, I have blocks of copy to appear in the email dynamically depending on some attributes about the email recipient:

Set @dynamicIntro = CONCAT("Congratulations, blah blah blah xxx Plan Shopping.<br /><br />Don't miss out blah blah blah. And discover ways to earn even more by <a href=""",RedirectTo(@Login),""">logging into your account</a> blah blah blah.<br /><br />")

Now, in the body of the email, I call the dynamicIntro variable that was set up top. I've tried calling it with a v() or with a TreatAsContent(), but no matter what I do, the copy block does not track the link (ie, redirect from ET's servers with something like "http://click.mydomain.com/qs?c1234545667743").

There must be some way to have the link tracked like all the other links in the email. Maybe using regions? Can anyone advise?

Thanks, Dave


As a workaround, I turned the string variable into two, one for everything before the link and one for everything after it. Then, in the HTML, I am calling them inline like this:

 %%=v(@firststring)=%% <a href="%%=RedirectTo(@Login)=%%">logging into your account</a> %%=v(@secondstring)=%%.

That works for now.

| improve this answer | |
  • I think the trick here is the RedirectTo() function isn't getting properly called and output, so you are presenting OMM with a string that happens to have a link. – Kelly J Andrews Feb 19 '14 at 22:38
  • If there is a way to call the RedirectTo() function that will actually redirect the link so it can be tracked, please just let me know! – David Fallon Feb 20 '14 at 20:30

Have you tried RedirectTo(TreatAsContent(@Login)). I think it's going to require that or it will just be a string when pulled initially.

| improve this answer | |
  • Hi Kelly J Andrews, I just tried that but no luck. To be clear, put the RedirectTo(TreatAsContent(@Login)) in the @dynamicIntro var using a CONCAT() as above. Then in the HTML, I called it using either v() or TreatAsContent() again. Sent the test email to myself and hovered over the link, and it just a flat link to the destination, not redirected off ET. Is there anything else I should be doing? Or maybe not use CONCAT()? Thanks for your help! – David Fallon Feb 18 '14 at 18:06
  • How are you sending the test email? through a standard send? – Kelly J Andrews Feb 18 '14 at 19:38
  • No, I go to Send Preview and send the test through there. But other links in the email are tracked when I do it that way, I'm not sure... Do you think that the test send may not track the same way as a live send? – David Fallon Feb 18 '14 at 21:00
  • You are technically doing a live send - not sure why this isn't getting built out - I'll do some testing and see if I can get it to render. – Kelly J Andrews Feb 18 '14 at 21:03
  • Thank you for your help. As a workaround, turning the string variable into two, one for everything before the link and one for everything after it. Then, in the HTML, I call them inline %%=v(@firststring)=%% <a href="%%=RedirectTo(@Login)=%%">logging into your account</a> %%=v(@secondstring)=%%. That works. I think the problem has to do with whether the declaration is in the %%[]%% or inline %%==%%. – David Fallon Feb 19 '14 at 13:54

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.