Getting Marketo to track a link created in a Velocity Token pulling a Custom Object value

Chris_Politzki
Level 2

Getting Marketo to track a link created in a Velocity Token pulling a Custom Object value

Having difficulties in getting this trackable by Marketo. Activity type should be 'Click Email' and not 'Visit Webpage'.

In Velocity Tokens:

Setting Custom Query Strings:

#set($campaign_days_map = {
90 : "?rc=5346&ac=2019&utm_medium=email&utm_source=marketo&utm_campaign=perpetual-wwall-email-renewal-90days",
60 : "?rc=5346&ac=2020&utm_medium=email&utm_source=marketo&utm_campaign=perpetual-wwall-email-renewal-60days",
30 : "?rc=5346&ac=2021&utm_medium=email&utm_source=marketo&utm_campaign=perpetual-wwall-email-renewal-30days",
7 : "?rc=5346&ac=2022&utm_medium=email&utm_source=marketo&utm_campaign=perpetual-wwall-email-renewal-7days",
0 : "?rc=5346&ac=2023&utm_medium=email&utm_source=marketo&utm_campaign=perpetual-wwall-email-renewal-dayzero",
-7 : "?rc=5346&ac=2024&utm_medium=email&utm_source=marketo&utm_campaign=perpetual-wwall-email-renewal-7dayspost",
-14 :"?rc=5346&ac=2025&utm_medium=email&utm_source=marketo&utm_campaign=perpetual-wwall-email-renewal-14dayspost"
})

Grabbing the Custom Object URL value, which is usually https://www.webroot.com/us/en/cart (also have tried without the https://):

#set($custom_query_string = $campaign_days_map.get($campaignDays))
#set($full_url = $TriggerObject.URL + $custom_query_string)

Setting the constructed URL with Custom Query String for the A Tag href value:

#set($anchorLink = '<a href="${full_url}" alias="Renew Now" class="mktoText primary-font button" style="background-color: #f96b07; border-radius: 3px; color: #ffffff; display: inline-block; font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-weight: bold; line-height: 46px; text-align: center; text-decoration: none; text-size-adjust: none; width: 100% !important;"><span style="color: #ffffff; font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-weight: bold; text-transform: uppercase;">Renew Now</span></a>')

Reference to the set URL + Query String Value in Content created by a separate Velocity Token:

<tbody> 
<tr>
<td class="primary-font button" style="-webkit-border-radius: 3px;-moz-border-radius: 3px;border-radius: 3px;width: 250px; height: 46px; text-decoration: none;font-weight: 700; font-family: 'Arial', sans-serif; color: #ffffff;font-size: 16px;text-align: center;line-height:13px;" bgcolor="#ff6a13" height="46">
<div class="mktoText">
<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="${full_url}" style="height:65px;v-text-anchor:middle;width:175px;" arcsize="6%" stroke="f" fillcolor="#f96b07">
<w:anchorlock/>
<center>
<![endif]-->

${anchorLink}
<!--[if mso]>
</center>
</v:roundrect>
<![endif]-->

</div>
</td>
</tr>
</tbody>

This creates the Activity Type of 'Visit Webpage', but we are hoping that the link gets wrapped in the Marketo tracking and creates an Activity Type of 'Click Email'.

Any help or assistance would greatly be appreciated, thanks in advance.

22 REPLIES 22
SanfordWhiteman
Level 10 - Community Moderator

Re: Getting Marketo to track a link created in a Velocity Token pulling a Custom Object value

Before dipping further, are you testing only in Outlook (I am asking because of the VML) or have you tested other clients?

Chris_Politzki
Level 2

Re: Getting Marketo to track a link created in a Velocity Token pulling a Custom Object value

At the moment, only Outlook, but I can run it through GMail here shortly, thanks.

Justin_Eichelb1
Level 2

Re: Getting Marketo to track a link created in a Velocity Token pulling a Custom Object value

I think Chris tested a Gmail a couple of weeks ago as he thought it might be an outlook issue. And if remember correctly, Gmail failed also.  But he's made code changes since then. So, his gmail test might have different results now.

SanfordWhiteman
Level 10 - Community Moderator

Re: Getting Marketo to track a link created in a Velocity Token pulling a Custom Object value

Yes, before I dive deeper into the workaround I want to make sure it isn't Outlook-only, because https://nation.marketo.com/community/product_and_support/blog/2017/03/01/those-bulletproof-buttons-a...

Chris_Politzki
Level 2

Re: Getting Marketo to track a link created in a Velocity Token pulling a Custom Object value

Same result in GMail, no Marketo Tracking.

I'll look at that article on buttons however, thanks Sanford.

SanfordWhiteman
Level 10 - Community Moderator

Re: Getting Marketo to track a link created in a Velocity Token pulling a Custom Object value

OK, I’ll figure this out later as I’m in meetings for a bit.

Chris_Politzki
Level 2

Re: Getting Marketo to track a link created in a Velocity Token pulling a Custom Object value

No worries, thanks and no rush.

I tried a hard-coded version of Custom Object URL value and it worked, but we want to be pulling in that URL field and not hard-coding it.

Here's what I used:

<tbody> 
<tr>
<td class="primary-font button" style="-webkit-border-radius: 3px;-moz-border-radius: 3px;border-radius: 3px;width: 250px; height: 46px; text-decoration: none;font-weight: 700; font-family: 'Arial', sans-serif; color: #ffffff;font-size: 16px;text-align: center;line-height:13px;" bgcolor="#ff6a13" height="46">
<div class="mktoText">

<a href="https://www.webroot.com/us/en/cart${custom_query_string}${custom_query_string}" target="_blank" style="background-color: #f96b07; border-radius: 3px; color: #ffffff; display: inline-block; font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-weight: bold; line-height: 46px; text-align: center; text-decoration: none; text-size-adjust: none; width: 100% !important; color: #ffffff; text-transform: uppercase;">Renew Now</a>

</div>
</td>
</tr>
</tbody>
SanfordWhiteman
Level 10 - Community Moderator

Re: Getting Marketo to track a link created in a Velocity Token pulling a Custom Object value

Yes, I sense you’re going to need a special technique usually used for multiple links, even though you seemingly have only one to output.

Chris_Politzki
Level 2

Re: Getting Marketo to track a link created in a Velocity Token pulling a Custom Object value

Actually, we are outputting the same link for 2 pieces of the email. I've only been isolating this button version, but there's also going to be one on a banner image eventually.