Automatically add utm parameters to links | Community
Skip to main content
Feb 16, 2016 4:30 PM UTC
Question

Automatically add utm parameters to links

Other marketing automation tools I've used have allowed you to globally set a url tracking template that will be added to all links.  Is there a way to do this?  When we create emails with links in them, I want marketo to automatically add utm parameters to pass data to google analytics, like /example.com/?utm_medium=email&utm_source=email-name&utm_content=text-of-link

Having to manually add these parameters for every link is a huge time drain.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

17 replies

Level 5
Oct 20, 2016 6:28 PM UTC

Hi,

When creating Email Templates in the new 2.0 with variables I added Local Variables to each module for both the link and the utm tag.

Here's an example:

Variables defined:

<meta class="mktoString" id="link-variable" mktoName="URL" default="#" mktoModuleScope="true">

<meta class="mktoString" id="utm-tag" mktoName="UTM" default="?utm_source=mkto&utm_medium=email&utm_campaign={{program.Name}}" mktoModuleScope="true">

Edit: The new program token for name can also show the program name from where the traffic came from, works good if you have a good naming convention.

Then where I add the links into modules I put it in like this:

<a href="${link-variable}${utm-tag}">

When editing each module it also allows me to for example add a &utm_content= if relevant or remove the whole utm string if it is irrelevant or linking to somewhere that would not support the querystring (exact link).

This can also be done by adding five variables, one for each utm_parameter and just have the default value blank like this:

<a href="${link-variable}?utm_source=${utm-source}&utm_medium=${utm-medium}...

To my knowledge if a link contains a blank utm_parameter with & following it should skip it in GA and add the next one.

/Erik

Translate
SanfordWhiteman
Level 10
Oct 20, 2016 9:08 PM UTC

To my knowledge if a link contains a blank utm_parameter with & following it should skip it in GA and add the next one.

Yep, a query key with no value (&key& or &key=&) is considered a param with an empty value (rather than an error).

Translate
Grégoire_Miche2
Level 10
Oct 20, 2016 10:02 PM UTC

Hi @Sanford Whiteman,

what happens if a utm parameter value contains white spaces? For instance, the {{program.name}} user may contain white spaces such as "My New Gated Content Program"

-Greg

Translate
Oct 6, 2016 11:14 PM UTC

I'm not sure if this is helpful or not... we too create unique UTM parameters for each email and store those in an excel file (so no good answer there).  However, we put a token {{my.tracking}} in our templates at the end of every link... so that way we only need to copy and paste the UTM parameter in the email token once... and then it automatically adds it to every link in the email.

In the new 2.0 emails - you could probably also just make a global variable that is appended to every link in the email too.

Again - these don't help if you're wanting the whole UTM parameter to be created automatically... but they do help so that you only have to add the UTM parameter once to the email (instead of having to add it to every link within the email).

<a href="/example.com/{{my.tracking}}" target="_blank">Random Link Example</a>

Translate
SanfordWhiteman
Level 10
Oct 7, 2016 1:43 AM UTC

There's also this bookmarklet I created to check for UTM params on all links. It won't add the params for you, but it'll run a pre-flight check to where they're missing.

I agree that tokens are essential minimizing the potential damage done by this missing feature.

Translate
Ravi_Ansal2
Level 5
Feb 17, 2016 5:57 AM UTC

Yes same as Josh, we created one spreadsheet with the drop down UTM values.

Translate
Josh_Hill13
Level 10
Feb 17, 2016 5:31 AM UTC

use a spreadsheet with CONCATENATE. There's one on my site.

Translate
Grégoire_Miche2
Level 10
Feb 16, 2016 4:38 PM UTC

Hi Justin,

Not possible. Referenced here: Just do it! Marketo so-called minor missing features​ 

-Greg

Translate
Mark_Knight
Level 3
Apr 22, 2020 8:44 AM UTC

This is so FRUSTRATING - this is basics, level 1 requirements, yet the functionality is missing (and as you point out in so many other areas too) when this is included in more basic (and cheaper) solution offerings.

 

Have any of your suggestions been taken up, or are Marketo (Adobe) just advancing to broaden functionality to make their solution have the new areas only a few will want whilst ignoring core areas that any marketeer would take for granted as being present in 2020 - checking whether a marketing automation system can automatically / easily integrate into GA in 2020 should be a given.... not something you have to retro fit yourself.

Translate