Need help with email UTMs

Milena_Volkova
Level 3

Need help with email UTMs

Hi all. I inherited a Marketo instance where a lot of things were developed over the years by different people. I am now trying to make my UTMs work in email.

What we need to happen is: 

When someone clicks a link for webinar registration, record the following in custom fields (note: these custom fields are also used by the javascript that captures UTM parameters from a form fill): 

  • Source - Last: UTM Source = mkto
  • Source - Last: UTM Medium = email
  • Source - Last: UTM Campaign = nurture

Here's what's happening: 

By default all email clicks get these values (notice the fields are different; are they out of the box?): 

utm_source: mkto

utm_medium: email

I don't know where to change these fields to the ones I need, i.e., where in Marketo I can specify the custom fields (Source - Last: UTM Source etc.) to be used for email clicks. 

In our email template, there is also a way to set a Global Variable for UTM Campaign (again, NOT the field we are using; likewise, I don't know how to change what field Marketo should use for it); also, there is only UTM Campaign field in the Global Variables, not utm_source or utm_medium (I don't need those fields, anyway, I need to use my custom fields like Source - Last: UTM Source etc.).

Milena_Volkova_1-1714773864433.png

Alternatively, I can enter the full URL like www.company.com/asset_name/?utm_source=marketo&utm_medium=email&utm_campaign=nurture in the CTA button URL, but it's a lot easier to have the source and medium for all email clicks to be set automatically, and even if I enter that whole URL every time, it gets messed up. Marketo still wants to use the UTM Campaign field rather than the field I need (i.e., Source - Last: UTM Campaign). 

It looks like an external process (the javascript?) updates that field, but there is no reference to it in the UTM capture javascript. 

Milena_Volkova_0-1714773293479.png

Sorry, this is so convoluted. Any help would be appreciated. 

10 REPLIES 10
tusharwagh1
Level 2

Re: Need help with email UTMs

Hi,

We can utilize UTM sources as hidden fields in Marketo Forms, such as 'utm_campaign,' as well as incorporate them into buttons, as you've mentioned: 'utm_campaign=campaign-name&utm_medium=email&utm_source=marketo&utm_term=na&utm_content=na.'

When used in hidden fields, all details will be tracked as the person fills out the form. Conversely, when employed in links, tracking will occur according to the webpage.

SanfordWhiteman
Level 10 - Community Moderator

Re: Need help with email UTMs

@tusharwagh1 please be attentive to the experience level of other posters.

 

It’s clear here that @Milena_Volkova already understands the general purpose and usage of UTM query parameters. In fact, Milena mentions having a JS UTM tracking library already in place, so there’s no need to review the basics of UTMs.

tusharwagh1
Level 2

Re: Need help with email UTMs

@SanfordWhiteman  Thank you for highlighting this. I'll make a note of it.

SanfordWhiteman
Level 10 - Community Moderator

Re: Need help with email UTMs


It looks like an external process (the javascript?) updates that field, but there is no reference to it in the UTM capture javascript. 

Milena_Volkova_0-1714773293479.png


Let’s drill down into this part. If you look at the details of the Change Data Value, you’ll see exactly what made this change. Please show a ‘shot of the details.

Milena_Volkova
Level 3

Re: Need help with email UTMs

HI @SanfordWhiteman thank you for your response. Is this what you are asking about? Sorry, the entire URL does not fit in. 

Milena_Volkova_0-1715015356429.png

 

Milena_Volkova
Level 3

Re: Need help with email UTMs

Hi @SanfordWhiteman I just realized that the form used in this case has the wrong field (UTM Campaign, instead of the Source - Last: UTM Campaign) as a hidden field. So silly of me. I'll update the form. But still, the question is, should I update the Global Variable in the email to the right field, and if so, how? Or should I use the full URL in the email CTA button? Thank you!

Dave_Roberts
Level 10

Re: Need help with email UTMs

It is likely that the Global Variable you enter in the editor is hard-coded to a UTM parameter on the links behind the scenes in your email template. While this creates an easy user-centric experience, it's also rigid and forces you into updating a specific UTM parameter that you might not want to use anymore (as seems to be the case here). 

 

In order to update the UTM parameter that the value updates (what you input into the variable box in the Email Global Variables) you'd have to open up your template HTML and track down how that Global Variable is applied within the HTML, likely built into the structure of links/buttons. 

If you're not comfortable with HTML or email code, you could grab the code from your email template and paste that into the community here so folks could help you identify and maybe troubleshoot the problem. If you're going to add code into the community here, it's helpful to use the toolbar Insert/Edit code sample button (found under the elipsis in the toolbar above the post) to add your code rather than just pasting it as text. 

Dave_Roberts_0-1715186331755.png

 

Food for thought:

If you're just inheriting an instance and trying to make sense or add some order/future-proofing to your setup, I might carefully consider removing this Global Variable all together and instead doing some instruction on how to add UTM values to links in an email so that you've got the flexibility to update this as needed in the future or omit it all together. While this approach certainly makes it easier on the end-user (whoever is building the email content itself), it also can create complications like this down the road and put you in a spot to require dev support when things change or to maintain iterative versions of a template with minor changes like the UTM parameters (if you were to keep them hard-coded). Perhaps there's a better solution for generating links w/ UTM values that would make it easier for the builders to copy/paste a fully-formed URL w/ parameters without needing to take such a rigid or heavy-handed approach. In the past I've seen many clients use a spreadsheet or small form-based app for something like this to start with a URL and construct the query parameters in a safe and reliable way.

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Need help with email UTMs

The direct problem here was that a variable tagged as “URL” was actually not allowed to include anything but a host + path.

 

That’s because in the template, this variable was concatenated with static text and another variable. Somewhat like this:

<a href="https://${ThingCalledURL}?utm_medium=email&utm_campaign=${ThingCalledCampaign}">

 

Obviously this causes huge problems unless there’s a clear procedure that says “the thing called URL doesn’t really accept URLs, only specific URL components.”

 

As you mention, this kind of restrictive setup can cause more harm than good.

NiharikaGoyal
Level 2

Re: Need help with email UTMs

Hi @Milena_Volkova 

 

Hope you are doing well.

 

I have checked the details that you have shared and as per my understanding you want to store the data for below URL to mentioned custom fields:

www.company.com/asset_name/?utm_source=marketo&utm_medium=email&utm_campaign=nurture 

  • Source - Last: UTM Source = marketo
  • Source - Last: UTM Medium = email
  • Source - Last: UTM Campaign = nurture

For this requirement if you have already JS on landing page then you have to adjust it with below approach: 

  1. Use JavaScript to Capture UTM Parameters: If you have JavaScript on your landing page that captures UTM parameters from the URL and saves them in the appropriate fields, ensure the script is set up to recognize the parameters and save them in the custom fields (Source - Last: UTM Source, Source - Last: UTM Medium, Source - Last: UTM Campaign) rather than any default fields.

Kindly check.

 

Thanks