Skip to content

Cyber Sale: Save big on Moz Pro! Sign up by Dec. 6, 2024

Analytics 2eba248

First Touch Tracking in Google Analytics

Will Critchlow

The author's views are entirely their own (excluding the unlikely event of hypnosis) and may not always reflect the views of Moz.

Table of Contents

Will Critchlow

First Touch Tracking in Google Analytics

The author's views are entirely their own (excluding the unlikely event of hypnosis) and may not always reflect the views of Moz.

It's time for a quick mid-week geek-out - I wanted to collect together a bunch of resources I have written on first touch tracking in Google Analytics including (for the first time that I'm aware of), the technical implementation details:

If you're the kind of person that unwraps your birthday presents early, you can skip to the punchline, grab the code you need to get first touch tracking working from Google code (don't forget to read the instructions!). Here's the meat from my detailed post:

Include following code anywhere above the Google Analytics code script in your page code:

<script type="text/javascript"
src="http://attributiontrackingga.googlecode.com/svn/trunk/distilled.FirstTouch.js">
</script>

Move your GA code above any Website Optimizer code or anything from Google that might write a visitor (__utma) cookie and look for:

var pageTracker = _gat._getTracker("UA-XXXXXXX-X");

pageTracker._trackPageview();

In between those two lines, you want to put the following line:

distilledFirstTouch(pageTracker);

Oh, and don't forget all of this is provided as is, with no warranty. I hope it will help you out, but only you are responsible for changes you make to your website and tracking code. Be extremely careful with live profiles and remember that you will need to do something different if you already use custom variables.

That's all for now folks. Enjoy your analytics, don't forget to drop comments with improvements, tips, tricks, abuse for writing such a short post etc. and if you need a primer on Excel to make the most of your new-found data, you can check out the recording of my conference call on how to be an Excel ninja (sign up for future calls here).


To distract you from this spectacularly short post, here are some really big things found on the internet this week:

Check out the depth of the ocean:

Ocean depth

As well as the size of the earth:

I also recommend watching this one.

Back to Top
Will Critchlow

Will Critchlow is CEO of SearchPilot, a company that spun out of his previous business Distilled, which was acquired by Brainlabs in early 2020. SearchPilot is an enterprise SEO A/B testing platform that proves the value of SEO for the world’s biggest websites by empowering them to make agile changes and test their impact.

With Moz Pro, you have the tools you need to get SEO right — all in one place.

Read Next

Directional Reporting in GA4 — Whiteboard Friday

Directional Reporting in GA4 — Whiteboard Friday

Aug 02, 2024
UTM Tagging for Google Business Profile — Whiteboard Friday

UTM Tagging for Google Business Profile — Whiteboard Friday

Jun 21, 2024
4 Surprising SEO Test Results — Whiteboard Friday

4 Surprising SEO Test Results — Whiteboard Friday

Jun 14, 2024

Comments

Please keep your comments TAGFEE by following the community etiquette

Comments are closed. Got a burning question? Head to our Q&A section to start a new conversation.