Understanding Campaign Tagging and UTM Codes in Google Analytics

It seems everyone uses Google Analytics, but if you ask most people, they would probably say they don’t feel like they’re using it to the fullest extent. Campaign tagging and UTM codes are overlooked by many marketers yet they're integral to understanding your return on investment. Campaign tagging has many advantages, but the bottom line is it is the only way to truly understand the efficacy of your campaigns. 

When a visitor comes to a site that has the Google Analytics tracking code installed, Google Analytics captures data via cookies like what kind of traffic it is, where the visitor came from, their browser, screen resolution, country, metro, etc. Campaign tagging allows you to overwrite this data with your own custom variables to get better insight into who this visitor is and why they’re coming to your site.

That’s powerful stuff.

But with great power comes great responsibility. Let’s dive into what campaign tagging is, why you would want to do such a thing, and how to set it up.

What is campaign tagging?

Campaign tagging is essentially adding code to the end of your link (a “UTM code”) that will tell Google Analytics what campaign that link is part of along with specific information about that visitor. It’s useful for a few reasons - we’ll get into the specifics shortly, but the largest reasons are that it gives you insight into a marketing campaign across multiple channels (social, advertising, email) and across multiple team members (say you have a team of freelancers all working for you).

For example, we have a customer who uses Malartu to aggregate their sales and marketing data into reports while using our professional services team to maintain their analytics accounts. They ran a campaign around Valentine’s day that offered a discount on their custom-made dog collars. In order to understand how their marketing efforts were performing across all their channels, our team set up campaign tagging. We named the campaign “FEB17Valentine” and appended a code we built in a code builder to every link in the campaign. These links were used in a variety of mediums across social media, email, and print advertising. They had different freelancers running each program, so campaign tagging allowed us to easily measure the efficacy of both the different mediums and the different freelancers.

Why campaign tagging?

Like in the example above, it’s useful to use campaign tagging to measure a team of different users. Here are a few other reasons it’s good to use:

  1. Campaign tagging consolidates all campaign data in a set of campaign reports so that it’s easier to understand.

  2. For paid advertising outside of Google AdWords (or AdWords campaigns with auto tagging disabled), visits show up as organic (not good). Campaign tagging sorts that out.

  3. If you’re running campaigns on other sites (like banner ads on affiliate sites) and you don’t tag those links, they will be included as referral traffic, skewing your organic results.

  4. Email is much easier to track through campaign tagging for a number of reasons:

    • Visits from desktop apps such as Outlook and Mac Mail, show up in analytics as direct because no referrer data gets passed.
    • Visits from webmail providers that default to a secure server (such as Gmail and Hotmail) don’t pass referrer data.
    • Visits from mobile often show up as direct because of issues with referrer data getting passed.


If you’re working to build traffic to your site, you need to know how effective your campaigns are. For almost any full-blown marketing campaign, this can only be done through effective campaign tagging.

How do you do it?

Straight up: through adding a campaign-specific UTM code on the end of your links.

To fully understand this concept, let’s quickly dive into the different parameters of the UTM code:

Medium: A big bucket describing the general area traffic is coming from eg. social, email, feed, affiliate, ebook, tv, print, radio

Source: The specific place the link lives. This further defines medium. Ie. Twitter, Facebook, Unbounce, Growthhackers, YouTube

Campaign: The name you’ve given to your campaign (eg. Weekly Newsletter.)

Pro tip: Don’t make the name too narrow in scope. For example, if you send an email each week, it’s really only important to know traffic came from the weekly email, not what week specifically (this will make analysis much simpler). Don’t include the Medium or Source in the campaign name, that will be confusing later on.

Ad-specific parameters:

Term: The keyword used for search ads. For other platforms, it is typically used for identifying the audience or the level below the campaign.

Content: The content of the ad, used for identifying which ad contains the link.

Here’s a quick cheat sheet:

The URL Builder

To easily create these campaign links, we highly recommend using a URL builder tool like the one below.

The key to this tool is to keep your campaign name consistent across mediums if it is all part of one campaign, like FEB17Valentine in my previous example.


Get tagging

That’s it! You’re on your way to understanding the performance of various campaigns and team members. If you have any questions about campaign tagging or want to discuss in more detail, reach out to our professional services team.