Google Analytics Campaign Tracking Pt. 1: Link Tagging

What is Link Tagging?

To track your marketing campaigns Google Analytics uses a technology called link tagging. This provides a fine level of detail about marketing efforts. The data we gather from link tagging helps us make informed business decisions about our marketing spend.

With link tagging, we add additional information to the destination URL used in an ad. The technical name for this additional information is the query string. Here’s an example:
http://www.cutroni.com/landing_page.php?utm_campaign=fall-sale
&utm_medium=banner&utm_source=boston.com&utm_content=text-only

*** NOTE: I moved some text to a second line for readability ***

Everything after the question mark is called the query string. Within the query string we have a number of parameters. Each parameter is separated by an ampersand (&). Pulling apart the above query string we find the following parameters:

utm_campaign=fall-sale
utm_medium=banner
utm_source=boston.com
utm_content=text-only

Each parameter can be further divided into two parts; a variable (the text on the left side of the equals sign) and a value (the text on the right side of the equal sign). Let’s break the above parameters into variable – value pairs:

Parameter Variable Value
utm_campaign=fall-sale utm_campaign fall-sale
utm_medium=banner utm_medium banner
utm_source=boston.com utm_source boston.com
utm_content=text-only utm_content text-only

Ok, stick with me. We’ve gone from a query string, to parameters, to variables and values. Now, let’s start to explain what all of this means. What are the variables and values? I’ll start by explaining the variables:

Variable Meaning
utm_campaign The name of the campaign. Think of this as a bucket. It holds all of our marketing activities. For example, we may be buying some keywords on Google, running some banner ads and sending out an email all to advertise our winter ski sale. However, these three activities are all part of a bigger marketing campaign, our ‘Winter Ski Sale’.
utm_medium I like to think of the medium as the mechanism, or how the message is delivered to the recipient (i.e. email, banner, CPC, etc). What is the ‘distribution method’ that is used to get our message out to our clients?
utm_source Think of utm_source as the ‘who’. Who are you partnering with to push your message. If you’re tagging CPC links the source may be Google, Yahoo! or MSN. This could also be the name of a service that will be pushing banner ads for you.
utm_content The version of the ad (used for A/B testing). You can identify two versions of the same ad using this variable.
utm_term The search term purchased (if you’re buying keywords). This is not always used and is NOT included in the above example.

It’s important to note that you do not always need to use every variable. The core variables are utm_campaign, utm_source and utm_medium. You should always use those three. With Campaign, Medium and Source you’ll reap the most benefit from Google Analytics.

Just to recap, link tagging is the process of adding additional information to the destination URLs we use in our ads. This additional information consists of variables and values.

Here’s the really cool part, the values. The value for each variable is a piece of business information that will end up in Google Analytics. Let me clarify that, you’re actually taking information that is specific to your business, like the name of a marketing campaign, and placing it in Google Analytics. GA will display it, exactly as it is typed, in a series of reports called the Marketing Campaign Results (see Part 3 of this series). This is extremely powerful because you can look at your analytics data through the lens of your business.

So now we know everything about what link tagging is, but what happens after we tag our links?

When someone clicks on a tagged link Google Analytics, using the urchin.js JavaScript, stores all the values in a cookie on the visitor’s machine. That way we can track the traffic generated by each marketing campaign. When a visitor completes one of our goals we can view the marketing activity that drove them to the site.

It’s important to understand that the cookie will persist until 2038. It’s also important to understand that the cookie will be updated with other information. For details about how Google Analytics stores various referral information please see the following post: How Does Google Analytics Track Conversion Referrals?

How to Tag Your Links

The process of Link Tagging is simple. Start by identifying the information that you need to place in the variables. You need to identify the campaigns, mediums and sources that you use in your marketing activities and place it in your destination URLs. Then modify your destination URLs to include the new variables and values.
How do you do that? You can use any text editor, the Google Analytics URL Builder or the special tool I discuss in Part 2 of this series. I’m partial to the special tool :)

Remember, if you’re placing links to your site in cyber-space, you should be tagging them.

Share this post:
  • Twitter
  • StumbleUpon
  • Digg
  • del.icio.us
  • Facebook
  • LinkedIn
  • FriendFeed
  • Sphinn
  • Google Bookmarks
  • Reddit
  • email
  • Technorati
  • Yahoo! Buzz

Like this post? How about checking out these related posts:

  1. Google Analytics Campaign Tracking Pt. 0: An Overview
  2. Tracking Offline Advertising With Google Analytics
  3. Tracking Dynamic Sites With Google Analytics
  4. Google Analytics Configuration Mistake #3: Third Party Domains
  5. How Does Google Analytics Track Conversion Referrals?

Comments

  1. christian says:

    What is your opinion regarding GA tracking vs. the good old fashioned SEO strategy of keeping links pure.

    Would google perhaps view the link with tracking as a paid link instead of organic?

    In other words, does a link take an authoritative, or equity, hit when it contains the tracking information vs. without out.

    What are your thoughts?

  2. Thanks for cool information. It gave me detail about Google tracking. I was looking for information, found here. Thanks

  3. Hi Christian,

    The link tagging parameters are only present when a visitor views a page after clicking on a tagged link. The link tagging parameters are not permanent, and therefore would never be seen by a a search engine.

    Hope that clarifies things,

    Justin

  4. christian says:

    Thanks Justin, but I’m not sure I agree.

    When I take my links with a campaign tagging, I am, inessence, adding tracking to those links in the form of variables.

    When a SE spider combs my site, sees the link to whatever landing page, it also sees the appended variables on the URL.

    My concern is that anything other than a clean link *could be* perceived by the SE as a paid link since it carries tracking variables.

    Google, especially, seems focused on separating paid links from organic links when applying link pop (or equity, or whatever), and my goal is to get the search engine benefit of relevant linking, and NOT get an organic link flagged as ‘paid’

    does that makes sense?

  5. Hey Christina,

    I think the part that we’re mixing up is where link tagging happens. You only add parameters to the links in your emails, banner ads, etc. You modify the destination URL that you place into your ad. You don’t actually change the URLs of any pages on the site.

    The only time the campaign parameters should ever be seen, by anyone, is when a visitor clicks on an ad with tagged links.

    SE crawlers should never see the link tagging parameters as the links with those parameters should only exist in ads.

    The only time that a SE crawler might see the query string parameters is if you post a link that contains the query string parameters on a message board, blog comment, etc.

    Hope that clarifies things,

    Justin

  6. Juvaly says:

    Hi Justin,

    When tagging a page with http://www.domain.com?langing.html?utm_source=src&utm_medium=med everything works as planned.

    However, this URL: http://www.domain.com?langing.html?utm_source=src&affid=123 causes direct referral information to be written to the _utmz cookie.

    Do you see something wrong with the second URL?

    Thanks,

    Juvaly

  7. Kathleen Devilbiss says:

    Are you aware of a way to manually code the campaign variables on a landing page? We have an affiliate program that drives traffic to a unique landing page and it would be easier to code the three variables on the landing page then to have to update all of the links to the page with these? Is there a way to do that?

  8. Hi Kathlene,

    We’ve been toying with this idea, but it’s really hard to implement. We would need to reverse engineer the GA tracking code and we’ve had little luck with that.

    This is a very common request and we’ve elevated it to Google.

    Thanks for reading and thanks for the comment.

    Justin

  9. Juvaly,

    I see a couple of things wrong with your URL. First, there are multiple question marks. You should only have one question mark to separate your path from the query string parameters and each query string parameter should be separated with a &.

    I also noticed you’re using one campaign tracking parameter. You need to use at least three (utm_campaign, utm_medium and utm_source) to track a campaign in GA.

    Hope that solves your problem!

    Justin

  10. Greg Moore says:

    Hi Justin,

    When using the EpicOne link tagging tool, I produced a result difference from the one from Google’s URL builder. When “term” contained three words, Google’s tool gave me a tagged URL like this:

    &utm_term=great%2Bred%20tulips

    …whereas the EpicOne tool produces

    &utm_term=great red tulips

    What do you think? Thanks!

  11. Robert says:

    Ok, so the link to the landing page is “tagged” with the url parameters, but what if the goal page is different than the landing page? Do I have to write code to propagate those url vars from the landing page to the goal page? Or will Analytics automatically associate a successful goal with the campaign vars from the landing page, even if those vars are not present in the goal page url?

  12. Robert,

    No need to propagate the tags in all your URLs. Once the visitor lands on the site GA copies the values out of the URL and stores them in a cookie. Then all visitor actions are attributed to the value in the cookie.

    Thanks for the question.

    Justin

  13. Greg,

    Thanks for the heads up. The Google URL builder does an encode on the white space. Not super important, but not a bad thing to replicate. We’ll try to add it in.

    We’re actually building that functionality into Analytics view. Look for it soon!

    Justin

  14. Rosanne says:

    Hi Justin,

    Do you have any info on naming conventions wrt link tagging?

    Thanks,
    Rosanne

  15. Hi Rosanne,

    I have 2 suggestions for link tagging:

    1. Be logical. Make sure your link tags can be understood by everyone in the organization.
    2. Be consistent. Don’t change the values that you use. Always use the same values for mediums and sources.

    Other than that, I like to add dates whenever possible, usually to the campaign name. I like to use simple things for medium, like “email”, “banner” and “cpc”. When it comes to email, I like to set the source to the segment of traffic receiving the email (more thoughts on email tracking here).

    Whatever you choose stick with it.

    Hope that helps and thanks for the question,

    Justin

  16. Thanks for these great tips. I now have the knowledge and confidence to ditch my expensive and cumbersome email tracking system and keep all results within analytics.

  17. Bob says:

    Is it possible by GA which particular user has been clicked on the particular tagged link and also how many times he clicked for particular user?

  18. Justin Cutroni says:

    @Bob,

    Technically yes, you can see which users click on links. But the GA TOS clearly states that you can not track any personally identifiable information in Google Analytics. Plus, tracking individual users will generate a TON of data, which is not particularly trackable. That’s why I don’t get into tracking individual users.

    Thanks for the comment,

    Justin

  19. Mike says:

    This question may already be answered in this thread… but it is too huge to scour through at the moment… I am wondering if I lose tracking accuracy in this situation…

    I post banner ads on websites such as http://www.racerxonline.com , and I add the tracking codes to the link back to my home page. I get tracking stats under the campaign tracking in GA, but I still get stats showing up in the referral category from racerxonline.com . Do I combine these two figures to make it accurate? Or are some of the figures being created on both ends from the same visitors?

  20. Justin Cutroni says:

    @Mike: It could be that some of the banners are not tagged with the link tagging parameters. Use the referring sites report to identify which pages on the referring domain have links back to your site. It could also be that, for some reason, the links are getting stripped off. And finally, is it possible that there are other, non-banner, links on the referring site?

    In a perfect world all of the traffic should appear from the banners.

    Hope that helps!

  21. Campaignsync says:

    Great post! One more tip, if you set your medium to cpc or ppc then those keywords will appear in the ‘paid’ section of your keyword report.

    Our tool, Campaignsync, can do all this tagging automatically to your Microsoft adCenter or Yahoo! Search Marketing campaigns. It’s free so try it out and let us know what you think.

  22. @Mike: It could be that some of the banners are not tagged with the link tagging parameters. Use the referring sites report to identify which pages on the referring domain have links back to your site. It could also be that, for some reason, the links are getting stripped off. And finally, is it possible that there are other, non-banner, links on the referring site?

Trackbacks

  1. [...] Google Analytics Campaign Tracking Pt. 1: Link Tagging [...]

  2. [...] In Part 1 of this series I explained that Google Analytics campaign tracking is based on a technology called link tagging. Link tagging is the process of adding business information to the URLs that we use in our on-line ads. But how do we actually tag these links? Some marketing campaigns can have hundreds, or thousands, of destination URLs. Google has provided a tool for us called the URL Builder. It’s great if you only have one or two links to tag, but it can’t handle hundreds of links. [...]

  3. [...] In Part 1 of this series I explained link tagging, the technology that Google Analytics uses to track on-line marketing campaigns. In Part 2 I discussed how to tag your links and posted a tool that I use to quickly tag large numbers of marketing URLs. Today, in Part 3, I’ll start to pull this whole thing together by walking through a very basic analysis. [...]

  4. [...] In Part 1 of this series I explained link tagging, the technology that Google Analytics uses to track on-line marketing campaigns. In Part 2 I discussed how to tag your links and posted a tool that I use to quickly tag large numbers of marketing URLs. Today, in Part 3, I’ll start to pull this whole thing together by walking through a very basic analysis. [...]

  5. Google Analytics at a Glance…

    How Does Analytics Track Conversion Referrals? Visitor campaign information is stored in a cookie on the visitor’s machine. This cookie stores the referral information for the visitor’s session. This cookie tracks organic referrals,……

  6. [...] Tracking Adwords and other ppc click results Paid Search SEM UncategorizedA passage I like very much on how to using analytics to track your advertise from difference sources using link tagging: http://www.epikone.com/blog/2006/11/10/google-analytics-campaign-tracking-pt-1-link-tagging/ [...]

  7. [...] Analytics Talk » Google Analytics Campaign Tracking Pt. 1: Link Tagging (tags: google+analytics) [...]

  8. [...] Google Analytics Campaign Tracking Pt. 1: Link Tagging [...]

  9. [...] By the way, make sure you configure your analytics app correctly to segment email traffic from other sources. This usually means tagging the links in your email. [...]

  10. [...] Remember, the values of Campaign Medium and Campaign Source can have a default value (like organic, referral or direct) or a set value that comes from the utm_medium and utm_source parameters used in link tagging. You can read more about link tagging in a previous post I wrote. [...]

  11. [...] The key to measuring the effectiveness of an email offer is identifying how many conversions occur. Measuring email conversions is pretty easy with Google Analytics. It all starts with link tagging. If you’re unfamiliar with link tagging then you may want to take a moment and review how it’s done. Testing emails with GA starts with creating different variations. Once the variations have been created you need to tag the emails so GA can identify each one. [...]

  12. [...] You can see that the name value pairs look very similar to the parameters we use for link tagging. Just by looking at the above cookie you can figure out that the visitor performed an organic search on Google for the term ‘google%2Banalytics%2Bshortcut’ or ‘google analytics shortcut’. That’s the type of information that we want to put in hidden form fields and send back to the server. [You can learn more about the __utmz cookie in the reference section below.] [...]

  13. [...] Campaigns: links that you have tagged with campaign information [...]

  14. [...] (For an alternative description, see Google Analytics Campaign Tracking Pt. 1: Link Tagging.) [...]

  15. [...] Name the filter. Choose “Custom” from the Filter Type drop-down menu. Click the “Include” radio button. Choose “Campaign Medium” from the Filter Field drop-down menu. Type “cpc|ppc” as the Filter Pattern. The “pipe” character is part of a regular expression that means “or”. For this feature to track your Google Adwords paid traffic correctly, Auto-tagging much be turned on in Google Adwords. Linking your Adwords and Analytics accounts will enable Auto-tagging. For it to work with other paid search platforms, you must use link-tagging. [...]

  16. [...] All About Google Analytics GoalsJustin Cutroni on All About Google Analytics GoalsJustin Cutroni on Google Analytics Campaign Tracking Pt. 1: Link Tagginghostmaster on All About Google Analytics [...]

  17. [...] cookie is named __utmz, I’ve talked about a few times, in my series on Campaign Tracking and my post on GA – CRM integration. __utmz always stores where the visitor came from (organic [...]

  18. [...] Google Analytics Campaign Tracking Pt. 1: Link Tagging [...]

  19. [...] Unfortunately, Yahoo and Mircosoft do not automatically tag paid keywords so the only way to track keywords is to tag them yourself. I know it sounds like it may take up the rest of your day, I assure you it is not as bad as it sounds. The first step is to go to the Google URL tool builder and make a tag for your keywords. If you would like some general information on how to tag links with the URL builder visit this blog post at Anayltics Talk. [...]

  20. [...] 延伸閱讀: Google Analytics Link Tagging 101 Google Analytics Campaign Tracking Pt. 1: Link Tagging [...]

  21. [...] Google Produktsuche kommen, erfasst jedoch nicht die Conversions. Es gibt aber eine Lösung über Link-Tagging, die den Filter überflüssig macht. In der Praxis funktioniert das [...]

  22. [...] (For an alternative description, see Google Analytics Campaign Tracking Pt. 1: Link Tagging.) [...]

  23. [...] (For an alternative description, see Google Analytics Campaign Tracking Pt. 1: Link Tagging.) [...]

  24. [...] cookie 的键是__utmz,我之前多次提到过它,在我的系列文章来源跟踪和文章 Google Analytics 与 CRM 整合里。__utmz [...]

  25. [...] first step is to go to the Google URL tool builder and make a tag for your keywords. This post at Analytics Talk is a great starting point if you need more information. After you get a feel for tagging [...]

  26. [...] Analytics, all you have to do is add in a couple parameters to the URL, there are some instructions here and [...]

  27. [...] Google Analytics Campaign Tracking Pt. 1: Link Tagging – Part 1 in my series about Google Analytics Campaign Tracking. Please note, I’m in the process of moving my blog to Analytics Talk. All new content will be posted there. Google Analytics Campaign Tracking Pt. 1: Link Tagging. Thanks! [...]

Speak Your Mind

*