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:
![]()
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:
Option 2) Place this code in the footer right before the tag:
(Replace the XXX’s with your profile account number)
Here’s a quick screenshot of the results:
![]()
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.



April 11th, 2007 at 6:50 pm
hi nice site.
April 27th, 2007 at 3:25 am
Is there a Certification for Google Analytics?
–
Yes I posted about the certification requirements.
Reuben
June 7th, 2007 at 9:17 am
You can do it the good way
http://www.google.com/support/googleanalytics/bin/answer.py?answer=55511&topic=11032
June 13th, 2007 at 1:46 pm
Doesn’t the new interface for google analytics have this feature?
—
Hi Heather
No it still doesn’t include any parameters in the Referring Site report.
Reuben
June 19th, 2007 at 11:54 am
Thanks for sharing info about this hack! I created the user defined report but can’t find it. What section of Google Analytics is it hiding in?
—-
Hi Sooz
It’s under Visitors > User defined
Reuben
July 24th, 2007 at 6:41 am
i think that you have to wait after google analytics counts some traffic using this filter… i think that this doesn’t have influence on statistics of earlier traffic
July 24th, 2007 at 11:53 am
Hi zden
Yes you’re right, when you apply a filter it only affects the reports ongoing.
July 29th, 2007 at 5:42 am
You can do it the good way
http://www.google.com/support/googleanalytics/bin/answer.py?answer=55511&topic=11032
——–
i am not sure but it think that this does something else… it only makes full URL from your pages not referers
July 30th, 2007 at 9:28 am
Hi zden
That filter will show the full URL of the pages on your site within the reports. It won’t show the referring URLs.
August 4th, 2007 at 1:16 pm
Hello Reuben,
Thank you for this great article. It appears you know how to manipulate the GA JS. I was wondering if you knew of any way that can help me add custom fields to the tracking mechanism, to be able to report on them.
Thanks!
John
August 7th, 2007 at 7:50 pm
US Army Medals - I’m not taking on additional projects right now, but there’s a lot you can do with the utmsetvar function which can place specific values into the user defined report, here’s an example: http://www.google.com/support/googleanalytics/bin/answer.py?answer=57045
August 30th, 2007 at 9:28 am
Hey Reuben,
Thank you for this hack. I implemented the first method and it’s been several days since, and yet I have not seen any change in the User Defined stats in my GA page. I followed what you wrote here word for word and compared the screenshot to my setup, so I don’t understand why I don’t see the full urls. Is there any timeframe that I should wait before start looking for an alternative approach (maybe method 2.) Although, the method 1 is much cleaner, and I’d really like to stick with that.
August 30th, 2007 at 7:53 pm
Hi volkan, send me a screenshot of the set up page or set me up with a login to the account and I’ll take a peek.
September 7th, 2007 at 3:00 pm
Hi Reuben,
Thanks for this article!
Quick question, aside from where you view the referring URLs, is there any other benefit from choosing Method 1 vs Method 2?
Method 1 seems like the easier (and safer) choice. So I’m just wondering if Method 2 has any other advantages?
Thanks!
September 7th, 2007 at 4:38 pm
Jackson: If you’re already using the user defined field for storing URL type info, then you could use method 2.
If you’re not able to edit the analytics code, then you can use option 1.
If you have access to the analytics code, then option 2 does give you a lot more flexibility as to which parts of your site you want to track referrers.
September 7th, 2007 at 11:18 pm
That clears it up :) Thanks again Reuben!
September 10th, 2007 at 6:49 am
thank you for the useful trick reuben , i ll keep an eye on your blog
November 5th, 2007 at 8:23 am
Hi Reuben,
Thanks for this tip. I did exactly what you said and it works. But here’s the problem. The full referring URL is still not visible when it’s very long. If you put your cursor over it, you can see it, like an alt-tag of an image, but that doesn’t help if you want to visit the referrer URL.
I tried View Source to copy and paste the referring URL, but it doesn’t show up in the visible code.
If you turn the data into a pdf, you can see the referring url as text, but when you go to copy it, it breaks the text at the end of each line!
Can’t you tweak the Google Analytics filter to convert the referral url into a text hyperlink for each referrer? I think website data programs do this. It would be very helpful.
Do you know how?
November 11th, 2007 at 10:02 am
Hi JT
In the previous version of analytics you could expand the columns, but that feature is sadly lacking. I’ll see if there’s another way to do it and write up a post in a few days.
February 5th, 2008 at 1:12 pm
Reuben - thanks so much for the detailed report & instructions. I’ve been wanting to add this forever, and never got around to Googling for it. Your post was the #1 result.
Two other things:
1) JT - if you export the results (PDF, CSV, etc.), the full URLs are there. Not as good as expanding the columns, but better than hovering over each one.
2) Reuben - I’m curious to learn about *how* this works (like, for example, what does (.*) mean, and how did you know to put $A1 in the Construction field. Is there a tutorial on filters than you can recommend?
Thanks again,
-Brian Greenberg
-http://www.familygreenberg.com/blog.htm
February 20th, 2008 at 10:57 am
Reuben,
Thanks for the great link. I’ve implemented your Option 2 suggestion, by adding the urchinTracker(document.referrer); code to the GA tag within my pages. It works great; however, after I made the change last week, it looks like my Bounce Rate calculation has changed. Screen shot here:
http://bp0.blogger.com/_bcLw_LVf5nA/R7xNkNOaa9I/AAAAAAAAAd8/zvCvlB5J9wI/s320/bouncerate.jpg
did you notice this? if so, any solution?
sodo
March 5th, 2008 at 10:17 am
Thanks for the post.
I implemented Method 1 and noticed that some of the URL directories appearing in the User Defined report was not appearing in the Referring Sites report. Has anyone else noticed that? and is there a particular reason why this would be happening?
Also, for those directories that do appear on both sites, the statistics are different (i.e. Pages/Visit Time on Site, etc.).
FYI: I do know that Referring Sites report does store the different query parameters in the string, and that to dive down into a directory, you must first click on the domain.