AnsweredAssumed Answered

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

Question asked by Chris Politzki on Oct 17, 2019
Latest reply on Oct 22, 2019 by Chris Politzki

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.

Outcomes