SOLVED

Links Inside Script Token Tracking Correctly?

Go to solution
Highlighted
Level 6 - Champion

Links Inside Script Token Tracking Correctly?

In my experience, if you're using a script token to define a link to be displayed in an email, those links are not trackable by Marketo. In all honesty, that makes sense to me. Marketo has no idea the link exists since it's inside the token code, not within the email itself.

However, I have found an exception and don't understand why. I have a token that will dynamically display a list of links, based on the preference center of a contact as to which items they would like to be updated on each month (up to 6 options). Doing this inside a token allowed us to send a single email asset to anyone with any selections and display that person's unique choices. My token code looks something like this:

<ul>

#if (${lead.update_1__c} == "1")

<li><a href="https://www.domain.com/link_1" target="_blank">Link 1 Update</a>

#end

#if (${lead.update_2__c} == "1")

<li><a href="https://www.domain.com/link_2" target="_blank">Link 2 Update</a>

#end

#if (${lead.update_3__c} == "1")

<li><a href="https://www.domain.com/link_2" target="_blank">Link 3 Update</a>

#end

</ul>

The output will be a bulleted list of links. Those links, when the email is sent, are getting wrapped in the Marketo redirect for link tracking (go.domain.com).

I don't understand how and why that is happening.  I am happy it is since it makes tracking engagement on this automated email much simpler, but I am trying to understand why it is working in this instance and not in other script tokens I've written that output URLs.

Any insights/ideas would be really helpful!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Level 10 - Community Moderator

Re: Links Inside Script Token Tracking Correctly?

I don't understand how and why that is happening. I am happy it is since it makes tracking engagement on this automated email much simpler, but I am trying to understand why it is working in this instance and not in other script tokens I've written that output URLs.

It's not surprising: that's expected behavior for static links emitted from Velocity.

In the cases where you've seen a problem, it's probably been because you were iterating over a list, ergo using $variables in your links (which can cause worse problems than just untracked links, it can break links completely).

View solution in original post

3 REPLIES 3
Highlighted
Level 10 - Community Moderator

Re: Links Inside Script Token Tracking Correctly?

In my experience, if you're using a script token to define a link to be displayed in an email, those links are not trackable by Marketo.

That's not true.  Any single Velocity-generated link is trackable, and multiple links that don't reference Velocity variables are also trackable. I've written about this extensively.

Highlighted
Level 10 - Community Moderator

Re: Links Inside Script Token Tracking Correctly?

I don't understand how and why that is happening. I am happy it is since it makes tracking engagement on this automated email much simpler, but I am trying to understand why it is working in this instance and not in other script tokens I've written that output URLs.

It's not surprising: that's expected behavior for static links emitted from Velocity.

In the cases where you've seen a problem, it's probably been because you were iterating over a list, ergo using $variables in your links (which can cause worse problems than just untracked links, it can break links completely).

View solution in original post

Highlighted
Level 6 - Champion

Re: Links Inside Script Token Tracking Correctly?

Hi Sanford,

Yep, you're right. Every other instance where I utilize scripting to output something similar is more complex than a single link, which does not allow the tracking to take place. Frankly this is a nice surprise so I'm happy to see it working!  Appreciate the insight you always share!