Initial Referrer: The missing metric in Google analytics
When it comes to tracking your marketing efforts it is important to consider the number of ways prospects will come into contact with your marketing collateral. The idea (sometimes known as multi-touch marketing) is that most of your prospects will not convert the first time they come into contact with your products/service, but are likely to be exposed to multiple messages via the corporate website, a banner ad, word of mouth et cetera.
Tracking multiple touches in Google Analytics is easy and they offer many ways at refining the data to get a clear picture of the different mediums prospects are using to visit your site, with one exception, the conversion. Google has decided that the last touch, the source that turns a prospect into a customer (or achieves a goal) is the touch that should get credit for the conversion. Which works out pretty good in most cases except it doesn’t factor in human behavior and the use of Search Engines.
The problem:
Say someone is looking for a waterproof video housing. They launch their favorite search engine (proabably Google) and type in the search term “waterproof video housings.” They see organic results and a Google ad (CPC) in the search results page catches their eye. They click it find a website called “Epic Camera housings.” They spend some time on the site doing a little research and leave. The next day they decide to go back to that “Epic Camera” website but they can’t remember the domain name. They fire up their search engine again, but this time they type in the name of the company “Epic Camera Housings.” They see the website they were looking for in the results page, they click on it, make a purchase and live happily ever after.
One problem, when the eMarketer is analyzing the conversion data for the campaigns he doesn’t see that the Pay-Per-Click (CPC) campaign was involved in that transaction. In fact many of the campaigns that were involved in the multiple-touch process of converting a prospect into a lead look like failed campaigns because they appear to not be converting.
What you would really like to see is the first source of a visit to the website and the last source.
The Solution:
A few individuals have created JavaScript to capture the initial referrer and add it to the User Defined field in Google analytics. The one that I like the best was present by Brian Clifton in his book, advanced-web-metrics, as it offers more flexibility in the data you can capture to the User defined field. There were a few errors in the code so I am presenting a corrected version here for you to use until his page gets updated: Initial Referrer source code
Just replace your current Google Analytics tracking code with this and make sure to change UA-12345-1 to your actual code.
You should start seeing data appearing in Google Analytics under Visitors/User Defined.
Let me know if you find this kind of article helpful and if you have any questions.
Related posts:
- Google Analytics Asynchronous Tracking for Joomla 1.5
- Mix n’ Match Analytics Campaign Tracking
- Did you just break your Google Analytics Installation?
- Barack Obama uses Google Analytics
- Tracking Corporate Activity with Google Analytics



Thanks for the code – I was actually discussing this with one of our analysts today. We knew Yahoo’s ad platform did this, but weren’t exactly sure how Google was doing it.
I’m still amazed at how much this “Free” tool can do. So many businesses are out there spending lot of money on Omniture and Core Metrics (which are great tools, don’t get me wrong), but so much can be done with free.
As Avinash Kaushik says about spending money on analytics: “put 10% into the tool, and 90% into the analyst.”
Thanks again.
Been trying to modify this code to track referrals from AdWords, but for some reason the source and medium don’t get filled in when a user comes from AdWords. Any ideas?