1

I noticed the links are not being tracked when the links are created into the AMPscript block (in between %%[]%%). When I hover the links in the email tests I receive they are normal links e.g. http://google.com instead of http://click.et.domainname.com/?qs=3847546732j4384672328h283464

What I have:

%%[

Var @type, @link

Set @type = [TYPE]

IF @type == '1' THEN

  SET @link = 'http://www.google.com'

ELSE

  SET @link = 'http://www.yahoo.com'

]%%

then I call link in my email body like this:

Click here to open your page.

When I hover is showing http://www.google.com for example instead of e.g.

http://click.et.domainname.com/?qs=3847546732j4384672328h283464

I tried using TreatAsContent() but again the links is printed as a string instead of being treated as a link and therefore being transformed by ET into a tracking URL.

Any thoughts?

Thanks, appreciate you input,

Vic

3 Answers 3

5

The answer turns out to be "use TreatAsContentArea". Like so:

  SET @link = "https://tdeasywebtour.com/sbb/sbb_en.html"
  SET @box1 = Concat('Get 24/7 online and mobile access to your Card Account with <a href=', @link, ' target=_blank style=color:#ffffff;>EasyWeb</a>.'

Then you call it like this in the email.:

 %%=TreatAsContentArea("someUniqueValue", @box1)=%%

Hope this helps!

5

Try the RedirectTo function of AMPscript.

It should be something like this:

%%=RedirectTo(@link)=%% (if link is set into a variable)

or

%%=RedirectTo("http://www.google.com")=%%

You can view all available AMPscript functions here.

1

You should be able to allow the link to track with use of RedirectTo() AMPScript function.

Below link gives some info on this and also your code would look similar to this:

%%[
Var @type, @link
Set @type = [TYPE]
IF @type == '1' THEN
SET @link = 'http://www.google.com'
ELSE
SET @link = 'http://www.yahoo.com'
]%%

Within the body of the email:

Click <a href="%%=RedirectTo(@link)=%%">here</a> to open your page.

http://help.exacttarget.com/en/documentation/exacttarget/content/ampscript/ampscript_syntax_guide/http_ampscript_functions/#RedirectTo

3
  • Thanks Jeremy, maybe my example is not right. Supposedly I have an entire sentence to call in the body and that sentence contains a link (or more links), how that will work? In this case the links are not redirected (tracked) by ET. RedirectTo always works when what I call is just the link.
    – Snowalker
    Commented Oct 29, 2014 at 19:19
  • How is the body of the email created and what does that look like? Are you retrieving content areas? Is this a paste-html or created from the editor? Are you able to update your original question to include more details? You should be able to include as much text as needed in the email without any issues. Any link that you are trying to track, would just need to be coded with the "redirectto" similar to the above.
    – Jeremy
    Commented Oct 29, 2014 at 20:33
  • Using the RedirectTo solution in my testing did not cause the links to get tracked (which is what I needed). Using Timothy's solution with TreatAsContentArea did allow the links to get redirected through the tracking redirector. Commented Mar 17, 2015 at 15:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .