8 Replies Latest reply on Aug 20, 2018 12:58 PM by Kyle McCormick

    Automatically append UTM codes to links within an email

    Meg Stout

      Hello! I've searched the community but haven't found a clear answer to this yet. We deploy a large number of newsletters, all of which share the same UTM codes. We have implemented local variables (in Editor 2.0) to help with tagging. But users are still forgetting to add "${utm-tag}" at the end of every link they insert.


      Is there a way, either with tokens or global variables, to define UTM codes at the template level so they are automatically appended to every link?

        • Re: Automatically append UTM codes to links within an email
          Yanir Calisar


          I've developed a free Chrome extension - UTM Builder for Marketo (http://bit.ly/UTM-Builder-For-Marketo).

          It's not a really automatic solution but it's annoying enough and might make more people remember to add these UTM's .

          • Re: Automatically append UTM codes to links within an email
            Kyle McCormick

            Hi Meg,


            I'd recommend using tokens, especially if you have multiple links or buttons in the email.  We have our tokens on the folder level, but you can easily have them in your templates as well (just depends on how much these will be changing). All of our tokens are on the folder level because we want every email sent that sits in that particular folder to have consistent UTMs.  What this looks like for us in the email link is two tokens: {{my.Em-6 Digital Asset URL}}{{my.Email Tracking utm}}


            {{my.Em-6 Digital Asset URL}} should be a local token in the template where your email manager updates the link to the asset

            {{my.Email Tracking utm}} should be either an inherited or local token for the utms.


            This way the field will not need to edit the link in the email and only edit it in the token, guaranteeing the UTM token stays in place.

            • Re: Automatically append UTM codes to links within an email
              David Gallagher

              It sounds like you are using email variables when you should be using tokens as noted above.


              I figured out the hard way that variables will not render when they are in an editable are of an email... ie image alt tag, a href etc. The intent is that you can drop in a module, update the text box on the right side and your variables are set. done. Reality hits as you noticed when those variables render as themselves rather than the intended content.


              1. I like using tokens for links in emails. Make sure that the http:// or https:// is hard coded before your token.
                1. https://{{my.EM - CTA Primary URL}}
                2. https://{{my.EM - CTA Secondary URL}}
                3. https://{{my.EM - CTA Tertiary URL}}
                4. Why? If you include the http:// or https:// in the token, marketo will not generate a tracking redirect link when it renders.

              2. Setup your UTMs as tokens and hardcode what makes sense...ie:
                1. https://{{my.EM - CTA Primary URL}}?{{my.EM - utm_campaign}}&utm_medium=email&utm_source=company&utm_content=newsletter&{{my.utm_term}}-button


              I usually have tokens ready and raring to go for each of my utms, but in certain cases, like this one, it makes sense to simply hard code what makes sense. I also mix-up the utm_term by combining a token with a dash and a fixed value based on the link location... -logo, -cta, -text -link, -ps, -footerlink and so forth...


              This has helped me quite a bit, but up to you how you want to role .


              Sidenote: Source does not always = Source

              With that said be cautious how you use and map your UTM SOURCE and UTM Medium. It is common that companies will link utm source directly to lead source during form fills, note that Lead/Person Source typically refers to the the general medium of entry ie: email, landing page, purchased list. This is much more like the UTM Medium by google standards. UTM Source is usually the name of the actual source, ie: google, facebook, etc.


              I know this was a bit long winded, but I hope this brings more clarity than confusion

              • Re: Automatically append UTM codes to links within an email
                Mark Price

                Hi Meg,


                Most often, I use program tokens for utm_source, utm_medium, utm_campaign.  This makes it so that after making 3 small edits all links in the email update. For more advanced implementations you might use the module variables for extra data points such as utm_term or utm_content. 


                You can set the link destination either in a token or in the module.  The determining factor for me is how complicated the message is + how many CTAs there are.


                Here's schematic that might help.



                • Re: Automatically append UTM codes to links within an email
                  Milena Mitova

                  You can try http://www.campaigntrackly.com. The Chrome extension lets you grab any link with a right-click action and open a pop up that will let you add pre-configured tagging templates. You can also track your campaigns and reports and it builds short links for you on the fly. It has multi-user access and numerous integrations and productivity features. Good Luck.