Table of Contents

Using and Standardizing UTM Campaign Variables in GA

The utm_ variables are one of the most powerful features of Google Analytics. UTM variables allow you to insert your own user-defined campaign source data into Google Analytics reports. For example, if you have an email campaign, you could tag the links in the message so that any website traffic it generates is attributed to the campaign. Same with a banner ad campaign, or even paid links from other sites.

To use the utm_ variables, you just append them to the query string of your URL:

http://www.startupcto.com/?utm_source=newsletter&utm_medium=email&utm_campaign=july_2011_newsletter
http://www.startupcto.com/index.php?utm_source=newsletter&utm_medium=email&utm_campaign=july_2011_newsletter
http://www.startupcto.com/index.php?action=loadpage&utm_source=newsletter&utm_medium=email&utm_campaign=july_2011_newsletter

Note in the last example, I already had a query string ( ?action=loadpage ), so I appended the utm_ variables with an & rather than a ?

The Five UTM Campaign Tracking / Tagging Variables

There are five UTM campaign variables; two required and three optional. Detailed examples are below.

ItemVariableDetails
Campaign Sourceutm_sourceRequired. Use utm_source to identify the source of your traffic, e.g. a search engine, a newsletter, a banner ad or another website.
Campaign Mediumutm_mediumRequired. Use utm_medium to identify the type of source, such as cost-per-click ad or an email.
Campaign Termutm_termUsed primarily for paid search. Use utm_term to note the keywords for this ad.
Campaign Nameutm_campaignUsed to identify a specific named campaign. utm_campaign allows you to figure out which campaign(s), of many you might be running, are most successful for you.
Campaign Contentutm_contentUsed for to denote which piece of content (of an A/B or multivariate test) was shown to the user. utm_content allows you to figure out which pieces of content are most successful.

Standardizing the Variables

In order to make your reporting easier, you'll want to be sure to standardize all uses of the utm_ variables. For example, you wouldn't want utm_medium=paid-ads for one campaign, and utm_medium=paid-media for another campaign. In GA's medium report, those would be reported as separate line items, which would force you to manually add the numbers every time you wanted to use them.

There's no official standard, but after years of doing this for companies from startups to Fortune 500, here's what I'd recommend that you consider. A few key points to keep in mind:

utm_source

The source (e.g. website, search engine, etc. your traffic came from).

utm_medium

The 'medium' for a campaign. As of Nov 2012, Google has (sort of) published a list of mediums that they recommend you use, in their channel grouping guide. According to the MM2Analytics blog, the only values that appear in the paid report are cpc, ppc, cpa, cpv, cpp, cpm

utm_term

utm_term should always be filled with the search term that the user used to find an ad. Note that this generally isn't used, unless you're clicking on search ads.

utm_content

utm_content is used for A/B testing. The exact value of this variable will depend on what types of tests you're running, but be sure to come up with a standard format for your organization.

utm_campaign

utm_campaign should be the name of the campaign that brought the traffic to your site. I like to use human-readable names with dates prefixed, e.g. utm_campaign=2011-march-my-big-banner-campaign.