3 Replies Latest reply on Nov 28, 2018 12:35 PM by Chris Wilcox

    Links Inside Script Token Tracking Correctly?

    Chris Wilcox

      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!

        • Re: Links Inside Script Token Tracking Correctly?
          Sanford Whiteman

          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.

          • Re: Links Inside Script Token Tracking Correctly?
            Sanford Whiteman

            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).