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 ?
There are five UTM campaign variables; two required and three optional. Detailed examples are below.
Item | Variable | Details |
Campaign Source | utm_source | Required. Use utm_source to identify the source of your traffic, e.g. a search engine, a newsletter, a banner ad or another website. |
Campaign Medium | utm_medium | Required. Use utm_medium to identify the type of source, such as cost-per-click ad or an email. |
Campaign Term | utm_term | Used primarily for paid search. Use utm_term to note the keywords for this ad. |
Campaign Name | utm_campaign | Used 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 Content | utm_content | Used 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. |
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:
The source (e.g. website, search engine, etc. your traffic came from).
utm_source=google
: for Google Adwordsutm_source=bing
: for Bing/Yahoo Adsutm_source=AGENCY-SITENAME
: for paid display ads trafficked by an ad agency. For example, if your agency was OMD and they were advertising on CNN, you'd have utm_source=omd-cnn.com
utm_source=misc-SITENAME
: for paid ads or promotions NOT trafficked by an agency. For example, misc-webhostingtalk.com
utm_source=product
: for offline product inserts (e.g. Brita filter reminder inserts)utm_source=email
: for any email campaignsutm_source=facebook
/utm_source=twitter
: for facebook/twitter/etc. Recommend you use this ONLY for unpaid links.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_medium=email
: for all email campaignsutm_medium=cpc
: for any cost per click search campaignutm_medium=cpm
: for any cost per thousand impressions campaignutm_medium=paid-media
: for all other advertising; this includes both CPM based advertising and other forms of paid media, but does NOT include the items listed above (e.g. search, social media, etc.)utm_medium=social
: for any social media page links, e.g. pages on Twitter, Facebook, YouTube, etc. Note PAID ads should be tracked via paid-media, cpc or cpm, respectively.utm_medium=mobile
: for mobile advertising; e.g. a text msg which directs users to the websiteutm_medium=link
: for unpaid links from other sites; paid links should be done via 'paid-media'utm_medium=offline
: offline ads, eg. a product insert. Note: highly recommend you do these with a redirect; e.g. http://www.brita.com/reminders redirects to http://www.brita.com/products/filter-change-reminders/?utm_source=offline. That keeps the print URLs short
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
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
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
.