I have an email for which the content is completely generated with velocity script.
In the content I create a list of links. The number of items in the list is different for every lead.
The problem is that I do not succeed in creating trackable links ( I refer to this post of Sanford : https://nation.marketo.com/t5/product-blogs/creating-trackable-links-even-when-a-token-includes-http... )
So before I generate the list, I already have some content which is avaliable in my variable ${output}, and then I continue like this:
#set( $link = "<a style='color:#00ADEF;text-decoration:underline;' href='https://www.dataline.eu/nl/" )
#set( $link = "${link}${j.u}${googleUTMString}")
#set( $link = "${link}'>")
#set( $link = "${link} ${j.t}")
#set( $link = "${link} </a>")
#set( $output = "${output} ${openListItem} ${link} ${closeListItem}")
All links are working fine, but are not tracked.
How can I solve this issue???
Solved! Go to Solution.
Instead of setting entire <a> through </a> in a variable - why don't you structure your script to something like below to output the data:
#set($url= "www.dataline.eu/nl/")
#set($dummyUTM = "?abc=def")
#set($linkText = "Click ME")
#set($output= "Some output ")
#set($openListItem = "dummy string ")
#set($closeListItem = "Blah")
${output}${openListItem}<a style="color:#00ADEF;text-decoration:underline;" href="https://${url}${dummyUTM}">${linkText}</a>${closeListItem}
Also, FYR - $link is a reserved word in Velocity for the LinkTool, I would suggest using a different name for storing the URL if possible. 🙂
Instead of setting entire <a> through </a> in a variable - why don't you structure your script to something like below to output the data:
#set($url= "www.dataline.eu/nl/")
#set($dummyUTM = "?abc=def")
#set($linkText = "Click ME")
#set($output= "Some output ")
#set($openListItem = "dummy string ")
#set($closeListItem = "Blah")
${output}${openListItem}<a style="color:#00ADEF;text-decoration:underline;" href="https://${url}${dummyUTM}">${linkText}</a>${closeListItem}
Also, FYR - $link is a reserved word in Velocity for the LinkTool, I would suggest using a different name for storing the URL if possible. 🙂
Hi,
thanks for the help. Problem solved.