Issue

URLs generated by a Velocity script token are not tracking when a person clicks on the link in an email
 

Solution

Velocity scripting enforces strict formatting of links in order for them to be tracked:
 
  • http:// or https:// must be included in the URL.  If using a variable, the http:// or https:// must be output outside of the variable.
  • The URL must be part of a fully formed <a> tag.  No other type of link tag will work
  • Links must not be outputted from within a for or foreach loop


To ensure links are tracked properly, set the entire path inside a variable and then print the variable.

Correct:

#set($url = "www.example.com/${object.id}")

<a href="http://${url}">Link Text</a>

 

Correct:

<a href="http://www.example.com/${object.id}">Link Text</a>

Incorrect:

<a href="${url}">Link Text</a> (missing http/https)

<a href="{{my.link}}">Link Text</a> (missing http/htpps, cannot reference an outside my.token)

<page xlink:type="simple" xlink:href="https://www.example.com">Click me</page> (must use an <a> tag)