Google Analytics Campaign Tracking Pt. 2: The EpikOne Link Tagging Tool

November 10, 2006 by Justin Cutroni

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.

To manage our link tagging effort we’ve created a tool in Google Spreadsheets that automatically generates tagged destination URLs. All you need to do is fill in the values for the Google Analytics tracking variables and a built in formula does the rest. Here’s a link to the file. Please help yourself :)

http://spreadsheets.google.com/ccc?key=p7c_HKcmspSUfEYSO0gskKw&hl=en

EpikOne Link Tagging Tool

How to Use The Tool

1. Click on the above link to open the Google Spreadsheet. Once open, use the menu in the top left corner (File > Export >xls) to export the file to your hard drive.

2. Once you have the file on your machine, open it using MS Excel.

3. Delete all the demo data in the file EXCEPT the equation in cell G8. Cell G8 contains the equation that does all the work.

4. Enter your campaign information into the corresponding columns. Enter a dash (-) for all variables that you are not using. You should always use the campaign, medium and source variables.

5. Add the destination URL to the destination URL cell. Don’t worry if your destination URL already contains query string variables, the tool is smart enough to handle them.

6. Cell G8 will automatically build your destination URL.

7. Continue entering your campaign data in new rows.

8. Copy the formula in cell G8 to other rows. The tagged destination URL will be created automatically.

After you have your destination URLs you can paste them into your on-line ads.

Let me know if you find this tool useful or a complete pain in the as*. Got a better tool and feel like sharing? Post a comment below!

*** Note: EpikOne assumes no liability for those that choose to use this file. ***

Subscribe:

How Does Google Analytics Track Conversion Referrals?

November 10, 2006 by Justin Cutroni

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, tagged campaign links, un-tagged referral links and direct visits.

Each time a visitor visits your site the Google Analytics Tracking code updates this cookie with the appropriate campaign information. When the cookie is updated GA discards the previous campaign information. As a result GA only tracks the current campaign information, not previous campaign information.

With that said, there is a ‘pecking order’ regarding which activities will overwrite the the data in the campaign tracking cookie. Let’s review how GA buckets your traffic in terms of referral information:

  • Campaigns: links that you have tagged with campaign information
  • Referrals: untagged links on other web page
  • Direct: people who type your URL into a browser
  • Organic: organic search engine traffic

Here is how GA updates the campaign tracking cookie based on referrer:

  • Direct traffic is always overwritten by referrals, organic and tagged campaigns
  • New campaign, referral or organic link that brings a visitor to the site always overrides the existing campaign cookie

Here’s an example. A visitor visits your site from a newsletter with tagged links. They look around and decide to leave. When they leave your site the campaign tracking cookie will persist and indicate that they originated from the newsletter.

The same visitor decides to come back the next day and types your URL into the browser. The campaign cookie will still indicate that the visitor arrived via your newsletter because the second visit was a direct visit, and direct traffic does not overwrite existing campaign information.

With that all said, you can configure GA to NOT overwrite the campaign data that is stored in the tracking cookies. This let’s you identify the first campaign that brought the visitor to your site. Here is the link:

http://www.google.com/support/analytics/bin/answer.py?answer=27247

However, this technique does NOT prevent the Google Analytics Tracking Code from updating the campaign cookie if a visitor arrives by organic search or untagged referral link. This technique can only be used to prevent tagged campaign links from overwriting previous referral information from a tagged campaign link.

So how do you get around this? Well we’ve come up with a hack that we’re using with a few of our clients. The goal is to store all referral information about a specific visitor across all of their visits so we get a better understanding of the sales cycle.

The Google Analytics Tracking Code re-writes the data in the campaign tracking cookie every time the visitor hits the site. We need a mechanism that can store data across multiple sessions and would only update the referral data and not overwrite it. To do this we wrote some JavaScript that uses the custom segment functionality to track the visitor’s referral information.

Here’s a brief outline for what the JavaScript does:

  • When visitor lands on the site check the previous referral information.
  • If there is no previous referral info then gather the referral info and store it in a custom segment using utmSetVar()
  • If there is previous referral info, then UPDATE the custom segment to include the current referral information

While this isn’t an ideal situation it does help. Using the User-defined report we can identify conversion rates for the various combinations of referral information that drove the visitor to your site during the sales cycle.

Obviously this takes some technical know-how. But if you’re working with a client, and the client wants to know EVERY step in the process then this is a hack that can help.

So there you have. Some information about how Google Analytics tracks referral information. I think there are two key things to remember.

  1. Not all referral information is created equal
  2. You can configure GA to let your campaign information persist

You may also be interested in the series I wrote about Campaign Tracking with Google Analytics:
Google Analytics Campaign Tracking Pt. 0: An Overview
Google Analytics Campaign Tracking Pt. 1: Link Tagging
Google Analytics Campaign Tracking Pt. 2: The EpikOne Link Tagging Tool
Google Analytics Campaign Tracking Pt. 3: Reports and Analysis

Thoughts? Questions? Leave a comment.

Subscribe: