Hi Justin,
Is this only static links within email scripts that are converted to Marketo tracking links, or should links generated by the script also be tracked?
For example, if we have the code: <a href="${URLToken}">link</a> in our script, should we be able to track clicks? I submitted a support case about this and was told these links cannot be tracked at all, but I inferred from your post in February that we SHOULD be able to track them. Did I misunderstand?
Thank you!
Correct, it is only fully formed links that are present within an email script. If the output of the script is a link, that will not end up tracked.
There's been more confusion about this recently, so let me clarify a bit more:
Tracking will not work unless you are outputting a fully formed <a> tag from the script and the protocol of the href link must also be present in the href in order for the tracking link to be generated. Also, always double check that any fields being used in the script are checked in the right-hand pane!
WILL BE TRACKED
#set ( $mylink = "www.marketo.com" )
<a href="http://${mylink}">Click Here!</a>
WILL BE TRACKED (if lead.FirstName is enabled in right-pane)
#set ( $mylink = "www.marketo.com?name=${lead.FirstName}" )
<a href="http://${mylink}">Click Here!</a>
WILL NOT BE TRACKED
#set ( $mylink = "http://www.marketo.com" )
<a href="${mylink}">Click Here!</a>
WILL NOT BE TRACKED
#set ( $mylink = "www.marketo.com?name=${lead.FirstName}" )
<a href="${mylink}">Click Here!</a>
WILL NOT BE TRACKED
#set ( $mylink = "www.marketo.com?name=${lead.FirstName}" )
http://${mylink}
(then in email itself)
<a href="{{my.script}}">Click Here!</a>
WILL NOT BE TRACKED
#set ( $mylink = "www.marketo.com?name=${lead.FirstName}" )
${mylink}
(then in email itself)
<a href="http://{{my.script}}">Click Here!</a>
WILL NOT BE TRACKED
#set ( $mylink = "name=${lead.FirstName}" )
${mylink}
(then in email itself)
<a href="http://www.marketo.com?{{my.script}}">Click Here!</a>
I'd like to add that this also works:
WILL BE TRACKED
#set($bodytext = 'Click <a href="http://www.domain.com/register.html">here</a> to register for the webinar.')
(then in email itself):
$bodytext
Or in a program token:
{{my.bodytext}} = $bodytext
I just added some more color here: http://blog.teknkl.com/marketo-doesnt-like-velocimacros-for-output-but-define-is-fine/
But will tracking still occur if I'm not setting a variable containing a url but instead just displaying a link if the condition is met?
#if ($field1 == "bread")
www.google.com
#elseif ($field2 == "butter")
www.yahoo.com
#else
www.bing.com
#end
Will clicks link activity be logged for anyone who clicks on the link within the email?