SOLVED

Tracking links in email script?

Go to solution
Anonymous
Not applicable
We have created an email script which creates a newsletter based off preferences users have set in our database. Everything works fine and it organizes content in the email based off preferences, however something seems to have happened where since we have included the email script in the email template we no longer have access to tracking clicks. 

Is there anyway around this?
Tags (1)
1 ACCEPTED SOLUTION
Justin_Cooperm2
Level 10
Hi all,

It is correct that this is currently a product limitation. Links are not decorated with tracking information if the link is inserted via email scripting. Our product team is aware of this limitation and it is something we'd like to resolve in the future.

Regarding sending sample emails, we are currently working on a bug fix so that links in sample emails will appear as if the email was sent as a production email (so you can see exactly what your lead(s) will see). Look for this to be released in the next one or two releases.

Thanks!

View solution in original post

25 REPLIES 25
Pepe_Serralvo
Level 2

Sorry about that, I created already a new thread with the issue.

Thanks!

Pepe_Serralvo
Level 2

Hi!

We have created an Email Template using Email Editor 2.0.

The links are being defined using variables:

<meta class="mktoString" id="c1ctaURL" mktoname="C1 - CTA URL" mktomodulescope="true" default="#" />

We applied the workaround mentioned in a few posts above in order to get these links tracked:

WILL BE TRACKED

#set ( $mylink = "www.marketo.com" )

<a href="http://${mylink}">Click Here!</a>

So the tag <a> in our template looks like:

<a href="https://${c1ctaURL}"

And of course, the c1ctaURL doesnt include any http

But after several tests, the links are not being tracked.

Are we doing something wrong here? Is there another solution to get this working since this post is from 2016?

Thanks!

 

SanfordWhiteman
Level 10 - Community Moderator

Doesn't sound like this is related to a user-authored Email Script token, so should be a new thread.

Anonymous
Not applicable
This is great!  Doing a little victory dance here and about to test this in my next campaign.

I also see that the preview feature now includes the ability to pick a specific lead and see email script tokens render in the preview the way that they will in the live message.  This is a new (or at least recent) feature, right?  I'm loving it - you can pick a list to filter your leads, then navigate directly to a specific lead.  Huge testing win for anyone using email script tokens.
Anonymous
Not applicable

This is great that this now works but a really bad implementation. Because now logic has to spread all over the place. I can't just create a token for the url, its really a token for the whole HTML including the <a> tag.

Justin_Cooperm2
Level 10
Correct, links in sample emails are now decorated and any link you place in an email script will be converted to a Marketo tracking link.
Anonymous
Not applicable

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!

Justin_Cooperm2
Level 10

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.

Justin_Cooperm2
Level 10

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>

Anonymous
Not applicable

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

SanfordWhiteman
Level 10 - Community Moderator
Wyatt_Bales4
Level 4

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?

SanfordWhiteman
Level 10 - Community Moderator

You have to output a fully-fledged <a> tag, but yes.

Anonymous
Not applicable
This appears to have been launched. 
Anonymous
Not applicable
Hey Justin,

Great to hear that you guys are working on this!

You've probably thought through the pros and cons already, but on the bug fix I would be careful about rendering the sample email exactly as if it were sent via production.  It's actually really helpful in testing to not see encoded links, but to see the constructed links without encoding.  In testing, you can hover over each link in the sample you've sent yourself and see that they are properly constructed (without necessarily always having to click).

Honestly, though, it would be even better to have a pop-up preview option while you're building a message so that you can pick a constituent and see the constructed message (without having to send the sample through the email rendering engine to your own or another's inbox).  MailChimp does this quite nicely, though the pain in MailChimp is having to cycle sequentially through each member of your target list to get to a specific test case.

At a minimum, it would be nice to have the option to control at the time of sending a sample message whether the links in the message should be encoded or not.

Thanks,

-patrick
Justin_Cooperm2
Level 10
Hi all,

It is correct that this is currently a product limitation. Links are not decorated with tracking information if the link is inserted via email scripting. Our product team is aware of this limitation and it is something we'd like to resolve in the future.

Regarding sending sample emails, we are currently working on a bug fix so that links in sample emails will appear as if the email was sent as a production email (so you can see exactly what your lead(s) will see). Look for this to be released in the next one or two releases.

Thanks!
Anonymous
Not applicable
Jiun - Sadly, your summary is spot-on. 

What's worse, if you try to construct a link using an email script token for just a part of the link, Marketo will actually cause that link to break when the message is delivered using trackable links.
Anonymous
Not applicable
In conclusion, if I understood the previous threads, Marketo currently does not replace links in Email Script Token with tracking links that would allow us the capability to track link performance within Marketo.

Hopefully in future versions the system can add tracking link after email scripting token is added.
Anonymous
Not applicable
Elliot -

The method you're describing works with standard lead tokens (e.g. http://www.foo.com/{{lead.First Name}}) , but does not work with email script tokens (e.g. http://www.foo.com/{{my.CustomToken}}). 

I have tested this extensively because of the ways we are using email script tokens in our Marketo messages.  I've also been navigating a related support case confirming all the details. 

You have to add the mktNoTrack class on any link that is built using email script tokens.  Otherwise, Marketo will mangle the link when the email is processed for sending.  Note that any sample messages you send will actually render everything just fine because Marketo doesn't make any of those links trackable during a test send.

-patrick
Anonymous
Not applicable
FYI -- I filed a support ticket regarding this issue and got the following potential solution. Haven't had a chance to try it yet but thought I'd throw it out there in case folks want to try it -- 

Thanks for getting in touch. Our email servers will add the tracking link before it populates script tokens. The way that our servers knows to add the tracking link to a set of text is if it sees the HTTP://, in this case it does not see this yet because the token has yet to be populated. 

To do this we ask customers to enter tokens which contain URLs as follows: http://{{my.DocumentLinks}} 

Your field then should not include the full URL ie: http://www.marketo.com but the URL minus the http:// so for example you should populate the field values withwww.marketo.com and the http:// will be manually added in the email to alert our system that this is a link.