This post explains how to set up URL tagging using UTM parameters and provides an overview of the different uses of URL tagging for marketing attribution.

Most marketers already understand how they can identify particular referral sources in Google Analytics, but tagging URLs using UTM codes takes this data to an advanced level and can isolate visitors referred from specific campaigns (specific email campaigns, for example) to understand their preferences and behaviours.

What are UTM Codes?

“UTM” stands for “Urchin tracking module.” UTM codes are added to the end of regular URL’s and are designed to tell Google Analytics (and other analytics tools) a little bit more information about each link and which marketing campaign it relates to.

The bold section of the URL below is a sample of what a UTM looks like:

utm link

A type of URL tagging, using UTM codes ensure your destination URLs are labelled with specific campaign names when they’re reported in Google Analytics.  Put simply, this enables you to break down traffic that’s usually only reported by its source and attribute it to individual emails or paid search campaigns that you’re running.

Why use UTM Codes?

Tagging URLs helps prove the value of online campaigns in which you’re attempting to drive traffic to your site, particularly if you have goals set up in Google Analytics, as it will report on each specific campaign’s conversion metrics.

For example, you can use UTM variables within links you post on social media to track how much traffic you receive from each post you publish. You could also use UTM variables to track specific links such as the link to your website from your your Twitter bio. URL tagging can also allow you to gain a greater understanding of the overall performance of each PPC campaign you’re running.  Search engines such as Google provide conversion tracking and statistics around impressions, clicks, CTR (click-through-rate) etc.  However, none of these stats explain how users behave ‘post-click’, which is why URL Tagging is so useful for advertisers.

How to Structure UTM Codes

In order to correctly structure your UTM codes you firstly need to understand what each parameter means:

  • Campaign Source is usually the search engine or platform that you’re running the ads on (Google, Bing, Facebook, Twitter, Website, etc.)
  • Campaign Medium is used to state the type of advertising campaign that’s using the URL (PPC, email, etc.)
  • Campaign Name is the field used to insert the name of your campaign.

These three fields are all required, and you can use the remaining content and term parameters to track additional details as explained by Google:

google campaign terms

Methods of Setting up URL Tagging

Manual URL Tagging

A lot of third party advertising tools have the option to automatically tag URLs, but for tagging specific links within organic social posts, banner links, and any other links used in campaigns conducted outside of third party software, manual URL tagging is the only option.

Now this doesn’t mean you have to craft every UTM tag by hand, as you can do this using UTM generators. There are a range of UTM generators available, but I have listed the most useful below:

Google’s URL Builder is a great free tool to generate URLs tagged with UTM codes for single campaigns, but is not suitable for creating UTM tags in bulk, nor is it great for keeping track of naming conventions.

Try our Free UTM Tagging Template

We’ve recognised that Google’s URL builder doesn’t provide the option to create and track UTM codes in bulk, so we’ve put together a UTM tagger template spreadsheet that will help you easily generate lots of UTM tagged URLs for any marketing campaign.

url tagging template

To start using the template, you will need to sign into a Google account. Once logged in, click here to view the free UTM tagging template, then click ‘File’ > ‘Make a copy’ to create your own version and start using it to tag your URLs.


Many third party tools have the option to automatically tag URLs using UTM variables. For example, Mailchimp, Buffer and Hootsuite all offer this functionality to paid subscribers.

Google AdWords advertisers should already be aware that Google offers an auto-tagging feature within AdWords which utilises UTM variables.

This feature is selected by default in all AdWords accounts, but if you’re unsure whether this has already been set up and would like to enable or disable auto-tagging you’ll need to navigate to Account settings > Preferences in Adwords:

auto tagging

Use Consistent Naming Conventions

If using manual tagging, ensure you choose a naming convention that’s easy to remember. For example, with the utm_medium= section of each URL,“Email” or “Display_Ads” are names that you may choose to repeat each time you launch a new campaign in each category. Tagging URLs this way means that you can break down campaign reports in Google Analytics and easily filter by campaign medium.

For the utm_campaign attribute, be sure to use descriptive tags to ensure you’re easily able to decipher what each campaign relates to when looking at the data in GA. For example, the descriptions on the left hand screen grab below are much easier to decipher than those on the right:

campaign name examples

This shows how important is is to use simple, descriptive text in the utm_campaign field where possible.

Improving the Appearance of Tagged URLs

It’s true that UTM codes create overly-long, unattractive URLs for users, but there is a solution to resolve this issue.

Let’s assume that we have just tagged the following URL:

The URL above looks extremely long and wouldn’t look too friendly to a user who clicks through to it.  However, your users never need to see it, thanks to the following snippet of code.  You would simply need to place the above link in some anchor text, such as click here.  Then on the corresponding landing page you would add the following piece of code to the HTML of the page:

_gaq.push(function() {

window.history.pushState(”,”, ‘some-page‘);


This means after the Google Analytics code collected all the attribution data from the really long URL tagging parameters I set in the example, the URL will revert to whatever is placed in the ‘some page’ quotes in the example above.

Where to Find Tagged URL Data in Analytics

Once you’ve become comfortable with the idea of tagging campaign URLs and have started to tag URLs across your online marketing campaigns, you’ll need to know where to navigate in Analytics in order to view the information the tags have been delivering.  The information you need can be found in Standard Reports > Traffic Sources > Sources> Campaigns.

campaign section of GA

The report will break everything down automatically by Campaign Name.  However, if any of your campaigns haven’t received any clicks, the parameters you’ve set won’t have been triggered and therefore those URLs will NOT be reported in this section until they’ve actually been clicked.


This post should have provided you with a basic understanding of what UTM codes are, how to implement URL tagging for Google Analytics, and highlighted a few potential uses of URL tagging for marketing activities.  As always, if you have any questions or comments then please feel free to use the comments section below or share your thoughts with us on Twitter.

18 responses to “UTM Codes: How to Track Campaign URLs in Google Analytics”

  1. Natalie says:

    Hi There,

    Wondering if you could please help as I have been tearing my hair out. I have set up some trackable URL’s but I did not take note of what they were (thought they would show up in my GA account).

    How do I see the URL’s I have created?

    How do I delete some of the campaigns I created? I created a bunch as I was learning how to do this?

    Thanks so much!

    • Ben Wood Ben Wood says:

      Hi Natalie,

      Thanks for reading!

      The URLs will only appear once someone has visited them. They will then appear under the acquisition > campaigns tab in analytics.

      There is no need to delete the URLs you created as nobody will be able to find them unless you’ve shared them via social media/email etc.

      Hope this helps.


  2. Natalie says:

    Hi There,

    Wondering if you could please help as I have been tearing my hair out. I have set up some trackable URL’s but I did not take note of what they were (thought they would show up in my GA account).

    How do I see the URL’s I have created?

    How do I delete some of the campaigns I created? I created a bunch as I was learning how to do this?

    Thanks so much! Would really appreciate some help!



  3. Naj Rellim says:

    This is a really dumb question, but where do you put the custom created URL once you have created it? In other words, how do you create this Custom Campaign Tracker after you have created the URL?


  4. Ashley Andrews says:

    Hi Ben,

    I have a question as well. Like Natalie, I set up a trackable URL, which I used in a promoted tweet campaign. But, even though the link did work, the code didn’t and website visits still showed up under direct traffic.

    The code I used was ?utm_source=twitter&utm_medium=social&utm_campaign=twt201411 and the website URL is

    Do you happen to know what’s wrong with this code or why it wasn’t working? I’ve completely run out of ideas.

    Thank you!

  5. Ben Wood Ben Wood says:

    Hi Ashley,

    Using the parameters at the end of the URL you’ve provided should work in principle – perhaps the reason it’s currently showing up as direct is because there’s a 301 redirect in place from to

    This will mean that the tracking parameters won’t be picked up if they’re used on the first URL (

    In this case, I would suggest adding those parameters to the URL that page redirects to:

    Hope this helps.



  6. Anish says:

    Suppose I create multiple campaign tagged URLs, but I want them to lead to the same destination page, and the destination page URL should be a clean one without the tags. How can that be managed?

  7. Thank you very much. Very useful.

  8. Isaac King says:

    Hello, thanks for sharing this.

    I do have an issue with the UTM codes messing up my Google Analytics reports.

    How do I remove them from showing up and creating multiple instances of a single page?

  9. Vartika says:

    Hi Ben,

    Looking for help.

    Google Analytics showing CPC visits but we’ve no PPC programs setup.

    There are two google analytics code on the website one for global and one for UK. I have asked the person to keep tag on respective site only.

    Signed up for adwords to do a basic keyword research but didn’t created any campaign yet. From the next day of adwords signup there are paid visits coming in analytics.

    How to resolve this.

    No manual tagging or auto tagging enabled I checked. UTM tags are not coming in campaigns – paid campaigns section. On selecting secondary dimension as – target url the visits url’s are of UK.

    Also it shows (not set) in keywords and destination url.

    Looking for a solution on this. The visit are coming daily after the signup done. Checked adwords no campaign setup , no tracking template, no auto tagging, no content exclusion


  10. Francesca says:

    Hi Ben,

    I’ve created several custom URLs in the URL builder but I can’t find them in my Google Analytics account!

    If I’m logged into my google account will they automatically link to this account? Do I have to do anything once I’ve created the links?



  11. Ben Wood Ben Wood says:

    Hi Vartica,

    Your traffic source will not show as CPC unless paid traffic is landing on your site. The UTM tags will only impact the campaign section of GA.

    I would advise checking out the google analytics implementation on your site, see whether you have tags on any pages which are being used to drive paid traffic to.

    If you’d like further help on this then please don’t hesitate to email us on [email protected]



  12. Oskar says:

    Hi Ben,

    I use UTM_ID to track our affiliate partners. Their ID is creating automatically. How could I check if we have a traffic from the link (e.g.

  13. thank you for the knowledge.

  14. Mariia says:

    Hello! Could you please help me with the question – Can I track the referrals from another websites to mine through the Google Analytics if my link doesn’t have a utm tag (if it is the general one like http://www…)? And if yes, how?

  15. Esther says:

    Hello, I have a question. If I have URLs for advertising on another website and I will create UTM links for them, then I should send the links with UTM tag to advertisers or how the GA will collect data from the campaign?
    And one more question I haven,t clearly understand how we can change display URL during using UTM because it’s too long.

  16. Kaj says:

    Thanks, I found this to be very helpful!

  17. Ostii says:

    Thanks for the article Ben.
    I would love to see one about the new Ad URL options that are in the Google Adwords ad editing screen.

Leave a Reply

Your email address will not be published. Required fields are marked *