First click & keyword funnel tracking with Google Analytics

by Patrick Altoft on July 22, 2009

Google Analytics has one major drawback for ecommerce sites – it only gives credit to the keyword or referring source a visitor clicked on the last time they visited the site.

This “last click” approach is what makes a lot of large ecommerce sites choose multi touch attribution analysis products such as Omniture and Coremetrics over the more user friendly and easy to use Analytics interface.

The main problem with “last click analytics” is that a large number of sales are credited to direct traffic & brand keywords (organic or PPC) simply because they were the last method used to find the site before a purchase was made.

In truth users often carry out a number of long tail product searches and generic keyword type queries as they research a purchase and then visit the brand site by searching for it directly after they have made the decision to buy. By not tracking the research phase of the transaction a lot of credit is taken away from the SEO campaign when in fact it’s often SEO that drives branded search.

The Solution – User Defined Values

Luckily there is a way to track the users first click with Google Analytics which goes a long way towards addressing the problem. By default Google Analytics only allows us to set one user defined value so if you want to track your 2nd, 3rd & 4th clicks then you need a small hack to stuff multiple values.

The first step is to understand the _setVar function which allows you to add a User Defined Value to each visitor.

To set a visitor segment, simply call the JavaScript _setVar function. For example, make the following call anywhere on the web page below your tracking code:

<script type="text/javascript">pageTracker._setVar('keyword');</script>

You can view conversion behavior for each of your custom segments from the Visitors Overview report. Click the User Defined link, then select the Goal Conversion tab.

Once you understand how to set the custom variable (it’s pretty easy) then you need to figure out a script to determine when to set it and who for. I’m not going to give code for this because all platforms are different but the basic method is as follows:

  • When a user visits check if they have a cookie with the first click referrer details
  • If there is no cookie set then generate a cookie with the referrer keyword
  • If they didn’t arrive from a search engine store the referring site or identify them as a direct visitor
  • If they already have a cookie then they are a repeat visitor and you can run the _setVar function

At this stage you might like to split your keywords into sectors using some kind of string matching algorithm. For example rather than just adding raw keywords you could group all certain keywords together as either “generic”, “brand” or “long tail”.

Viewing the Results

The data is presented within the standard search engines reporting section of Analytics by clicking on:
Traffic Sources > Search Engines > Google > Brand Keyword > Non-paid > Ecommerce tab > User defined value

What you are able to do is drill down into the

First click & keyword funnel tracking with Google Analytics

We’ve been able to credit a lot of extra sales to SEO which would normally have been allocated to direct traffic or brand keywords. Would be interested to hear your results too if you decide to give it a try.

Patrick Altoft is Director of Search at Leeds based digital & SEO agency Branded3. Patrick also runs Blogstorm.

You can get our blog posts delivered for free by email every day - simply add your email address to the box below or alternatively grab the RSS feed.

Read some similar posts

{ 8 comments… read them below or add one }

eivindsavio 22 Jul 2009 at 11:24 pm
Find me on Twitter

Interesting solution.

If I don’t remember wrong, Brian Clifton has in his book “Advanced Web Analytics with Google Analytics” written about a different solution that will track more than the last click.

I just want to add that direct traffic will not be credited for the conversion if the visitor has visited the website before.

If the visitor arrived through organic/paid/referred/tracked campaign on the first visit, and then returned to the website as direct traffic on the second visit and then converted, direct traffic will not be credited for the conversion. The previous source will get the credit.

More comments from eivindsavio
James Holmes 23 Jul 2009 at 1:06 pm

I also believe that in the case of direct traffic, this will not be credited if Google Analytics can see that the previous visit to the site was from another source.

Google Analytics does however attribute transactions to the most recent source, except in the case of direct traffic. However, this behaviour can be modified by adding the following to the end of all of your tagged links:

&utm_nooverride=1

When Google Analytics detects this variable, it will retain the first campaign’s information, regardless of which links the user later followed to arrive at the conversion.

Luci 23 Jul 2009 at 5:28 pm
Find me on Twitter

A valid hole in Analytics you pointed out there, one i am guilty of doing as well (in user-search terms). Great explanation and solution to the problem, thanks!

More comments from Luci
nemokami skelbimai 24 Jul 2009 at 3:43 am

great and helpful stuff

kewald 24 Jul 2009 at 7:39 am
Find me on Twitter

The reason the idea of using SetVar is not a perfect idea is, that there’s a hard coded maximum of 50.000 unique SetVar values. A better approach, is to use Advanced Segments to show keywords and traffic sources segmented against the order of the visit, so you can see first time visitors behavior, second time behavior etc. Or take a look at Urchin – the Software inside Google Analytics.

More comments from kewald
John Santangelo 04 Mar 2010 at 4:27 pm

Any tips on how to pull this off with Yahoo Web Analytics?

Tom@Google SEO Keywords 18 Mar 2010 at 8:09 pm

Thanks dude, i love your seo ideas. Keyword analysis is the most important and hard work in search engine optimization. Google top and expensive keywords are very important to find out. Worth reading SEO article mate. I am going to bookmark your site, Cheers.

Lee 11 Jun 2010 at 9:34 am

I would like to be able to have first click wins in one Analytics profile and Last Click in another – is this possible?

{ 6 trackbacks }

Web Analytics TV Episode #6 with Avinash and Nick « Analytics Expert
02.24.10 at 1:05 am
Web Analytics TV Episode #6 with Avinash and Nick « Analytics Expert
02.24.10 at 1:05 am
Web Analytics TV Episode #6 with Avinash and Nick | Rodney Payne
03.06.10 at 12:02 am
Aitir Google Lab » Web Analytics TV Episode #6 with Avinash and Nick
03.25.10 at 5:34 am
Web Analytics TV Episode #6 with Avinash and Nick | Analytics Expert Blog
04.05.10 at 10:26 pm
Web Analytics TV Episode #6 with Avinash and Nick « lcs
05.14.10 at 5:56 am

Leave a Comment (registration is optional)

Registration is free, takes about 5 seconds and is worth doing.

You can use these HTML tags and attributes:
<a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>