Hacks
These Google Analytics hacks and downloads have been documented either as posts in the GA Hacks category or are part of the book – Advanced Web Metrics with Google Analytics . They have been tested as working with Google Analytics and should also work with Urchin software. Please feel free to post comments on these, use as you wish, or even add your own hack. If you have done something clever with scripting for GA or Urchin, I would love to hear about it.
If you would you like to be notified when I update the book, modify scripts or write new whitepapers , simply leave your e-mail address below.
As with all scripts presented on this web site, use is at your own risk. I take no responsibility for errors or any other complications arising from the use of this code.
***Update 30-Mar-2010:
Code examples for the 2nd edition. I am in the process of uploading scripts and other goodies for readers of the book second edition. Please bear with me a couple of weeks... BClifton
Scripts for ga.js:
- Combined tracking script (related post )
- Tracks outgoing links - Automatically
- Tracks file downloads - Automatically
- Tracks mailto links - Automatically
- Customising the list of recognised search engines (related post )
- Adds 100+ regional search engines for detection as a search engine (rather than listed as a referrer)
- Differentiates regional variations e.g. google.co.uk, google.com, msn.se etc.
- Tracks Google Local (maps.google.com)
- Tracks bing.com (see post )
Scripts for urchin.js (legacy code):
- Combined tracking script (related post )
- Tracks outgoing links - Automatically
- Tracks file downloads - Automatically
- Tracks mailto links - Automatically
- Customising the list of recognised search engines (related post )
- Adds 100+ regional search engines for detection as a search engine (rather than listed as a referrer)
- Differentiates regional variations e.g. google.co.uk, google.com, msn.se etc.
- Tracks Google Local (maps.google.com)
- Tracks bing.com (see post )
- Track outgoing links - Automatically now deprecated - use combined tracking script above (related post )
Book specific (first edition):
No book can be perfect, so also check the list of Google Analytics book corrections and typos .
- Chapter 1: Table 1.2: Economic effect of increasing your conversion rate.xls
- Chapter 9: page 180: Differentiating Regional Search Engines
- Chapter 9: page 205: Capturing the first-and-last-referrer.txt
- Chapter 10: Figure 10.1: KPI-example-spreadsheet.xls
- Chapter 11: Figure 11.8 - cpcmax-calculator.xls
Ratings for this page:



(48 votes, average: 4.50 out of 5)
August 23rd, 2010 at 10:41 pm
Does the combined tracking script work with the new asynchronous tracking code?
August 27th, 2010 at 8:19 am
Alanna: At present I haven’t produced an asyn version. However, stay tuned for news on this in the coming weeks
August 31st, 2010 at 7:11 am
The hack for converting google image traffic from referral to organic is not working for sometime now. Can you please update us on this.
August 31st, 2010 at 8:12 am
Beno: What issue are you getting with the image search hack from the book? Its not something I use a lot…
August 31st, 2010 at 1:38 pm
In your book, there is a topic on “Capturing Google Image Search”, you had mentioned by modifying the GATC code and advance filter the traffic from Google image search will be shown as organic, this was working well, but lately, this modification is not working and shows Google image traffic as referral. Please advice.
August 31st, 2010 at 5:06 pm
Beno: I am not aware of any changes for Google Image search that would impact this i.e. the referral URL still contains the prev parameter. I will put aside some time to set this up for one of my sites and check to verify. What version of the GATC are you using? Note, the book code is for the standard installation i.e. not the async method.
Update: the last image search I have for this method was on 18th Aug and the keywords were extracted ok.
September 1st, 2010 at 11:03 am
I’m using the ga.js code. Only a few of them (image search terms) are shown as google/organic, the remaining are shown under google/referral and their referral path is /imgres.