Reuben Yau

Online Marketing Consultant (SEO Consultant)
Posted Monday, January 15th, 2007.
Filed under Google, Google Analytics, SEO

It’s so frustrating that you can’t usually find which forum thread is linking to your website, because under the referring site report, cross segment performance, content report, it truncates the URL at the end of the filename, so you end up with items like:

/forums/showthread.php
/forums/viewtopic.php
etc.

There are two options, the first is a hack which uses filters to place the referrer into the User Defined Report (thanks to tresman and Pyrana), while the second uses a modified version of the Google Analytics tracking code to place the full referrer into the Top Content Report.

Method 1 – User Defined Report

Add this filter to your Analytics profile:

Custom Filter
Advanced
Field A -> Extract A: Referral (.*)
Field B -> Extract B:
Output To -> Constructor: User Defined $A1
Field A Required: Y
Field B Required: N
Override Output Field: Y
Case Sensitive: N

Here’s a screenshot of the filter settings:
Google Analytics Filter Settings

Results:
User defined referrer tracking

Two of the major benefits is that you don’t have to mess with the Google Analytics code and it uses the User Defined Report which goes unused in most cases.

Method 2 – Hacking the Analytics Code

I managed to find a way to use the urchinTracker function to place the exact referring URL into the Top Content Report, use one of these options (not both!):

Option 1) Place the standard tracking code in the HEAD section of the page and use this body tag:
<body onload="javascript:urchinTracker(document.referrer);">

Option 2) Place this code in the footer right before the tag:

<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>

(Replace the XXX’s with your profile account number)

Here’s a quick screenshot of the results:
Analytics Exact Referrer Using urchinTracker hack

Once you run this report, you can then apply a filter at the top of “http” to only show the exact referrers.

The urchinTracker script is usually used for tracking javascript or Flash events :
http://www.google.com/support/analytics/bin/answer.py?answer=27229

Update: If you can’t edit the HEAD or BODY tag or want to keep the tracking code in the footer, check out the Google Analytics Full Referrer Update.

Update 2: I’ve augmented the tracking code to also detect if the page is served in http or https mode to serve the appropriate call to the urchin.js file, and also detecting whether the referrer is internal or external so you don’t get your site appearing as a full referrer in the Top Content Report. View my Ultimate Google Analytics Tracking Code.

Update: 5/10/07 – I confirmed that this hack still works with the new version of Google Analytics.

If you’re a webmaster about to do a redesign, you may want to look into some interesting free icons for your website.


Rate This Post
1 Star2 Stars3 Stars4 Stars5 Stars (11 votes, average: 4.91 out of 5)
Loading ... Loading ...
ReTweet This Post

Related Posts

If you found this page useful, consider linking to it.
Simply copy and paste the code below into your web site (Ctrl+C to copy)
It will look like this: Google Analytics Hack – obtaining full referring URL


Comments

Pings/Trackbacks

Post A Comment

(All comments are held for moderation)