URLs in Email Script Token not tracking
Issue Description
URLs generated by a Velocity script token are not tracking when a person clicks on the link in an email
Issue Resolution
Velocity scripting enforces strict formatting of links in order for them to be tracked:
- or must be included in the URL. If using a variable, the or 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="${url}">Link Text</a>
Correct:
<a href="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="example.com">Click me</page> (must use an <a> tag)