Show Full Referring Source in Google Analytics

analyticsreferrer_20070410.jpg
If you use Google Analytics and you've ever tried to determine what URLs are referring to your site, you may have noticed that the report only includes the file name portion of the URL, excluding the query string. If your referrers are dynamic forums and bulletin boards, this makes it impossible to tell what message or thread has linked to your site. All you may see are a bunch of referrals from "/forums/viewtopic.php" since the full article path is encoded in the query string.

Reuben Yau came up with a nice hack that solves the full-referrer problem. The hack uses urchin's manual javascript tracking mechanism, typically used to track flash events, to register a page view with the full referring URL as the title. Just update your tracking code with the following:

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-XXXXXX-X";
urchinTracker();
urchinTracker(document.referrer);
</script>

After you've made the change, you'll start seeing referring URLs showing up in the main content reports (as opposed to the "referring source/cross segment performance/content" report). They'll look a little different from typical content, as the content name will contain a full http:// URL. You can then filter the report for "http:" if you only want to view the referrer data.

Google Analytics Full Referrer Tracking -Link.

Posted by Jason Striegel | Apr 10, 2007 06:52 PM
Google, Web Site Measurement | Permalink | Comments (0) Bookmark and Share

Recent Entries

Comments

Newest comments listed first.

Leave a comment



Bloggers

Welcome to the Hacks Blog!

Brian Jepson.Brian Jepson


Jason Striegel.Jason Striegel


Philip Torrone.Phillip Torrone



See all of the books in the Hacks Series!
Advertise here.

Recent Posts

www.flickr.com
photos in Hacks More photos in Hacks

Most read entries (last 30 days)