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.
Like this post? Share it:
And how about checking out these related posts:
Subscribe to RSS Feed »
Follow me on Twitter »
Connect on LinkedIn »
Connect on Google+ »
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?
Thanks for cool information. It gave me detail about Google tracking. I was looking for information, found here. Thanks
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
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?
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
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
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?
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
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
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!
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?
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
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
Hi Justin,
Do you have any info on naming conventions wrt link tagging?
Thanks,
Rosanne
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
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.
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?
@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
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?
@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!
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.
@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?
[...] (For an alternative description, see Google Analytics Campaign Tracking Pt. 1: Link Tagging.) [...]
I had a question about campaign tracking codes. You are only suppose to place these on links that arrive on your site from third party content (emails, banners, social sites, etc). Correct me if I’m wrong, but you should NOT be placing these on links within your site. For example, if you have a promo tile on your site you don’t want to track that cross-link on your internal site with a campaign code, correct?
Thanks for the clear explanation Justin. One question:
Is it safe to put a 301 redirect on this:
http://www.cutroni.com/landing_page.php?utm_campaign=fall-sale&utm_medium=banner&utm_source=boston.com
to this:
http://www.cutroni.com/landing_page.php
Would the campaign tracking still be caught before the 301 redirect? This would be a great way of getting the initiating the campaign tracking, and then forwarding the user to the unmodified URL. Would like to know your thoughts. Thanks!
Hi Bill,
Unfortunately no. The GA JS will not have fired in time. You need to make sure that the utm parameters are in the URL when the visitor lands on the site. However, if I remember correctly, you can create a 301 that let’s the query parameters persist. But double check me on that, I’m no SEO expert.
Justin
Hi, i am facing the strange problem that a link tag url, that i have added in an swf is indexed in google!! how is this possible? the link url is sth like http://www.sitename.com/?utm=etc... is this happen because the string query goes without a .php or html? thank you for in advance
@vangelis – Google is indexing that URL because it’s a completely valid URL. You can use Google’s Webmaster Tools to define a canonical URL and remove the duplicate with the utm_ parameters.
Hi all,
I always thought Campaign Tracking is used when a company/an individual sends out emails relatively rarely as the links should be generated manually with the URL Builder and then added to the links in the email manually. Is this right?
What about regular newsletters? What if a website sends out daily around 10 different emails to more than half a million subscribers? The content/links in those emails is generated automatically based on the content published on the site in the past 24 hrs. Is it possible to use campaign tagging in an automated way so that every link in a new email gets tagged automatically (e.g. medium, campaign name, links position in the mail and month) before the email gets sent out?
Thanks a lot!
Hi Newbie, if the email is pointing people back to your site then you should tag the links. If you don’t tag the links then how will you know how much traffic you get from the email newsletters? Most email tools have some type of GA plugin that will automatically tag the links for you. Ask your provider. If you’re using a home-grown tool then I suggest you tweak it to automatically tag the links for you.
Hope that helps!
Justin