How to Redirect and Keep Referrer Data for Web Analytics

How to Redirect and Keep Referrer Data for Web Analytics


by Rob Newhouse
Analytics Consultant

8 July 2010

As many will have heard, cool URLs don’t change, but in the course of the life-cycle of a typical website it invariably happens. And when it does, the only reasonable solution is to redirect users to the new location for content.

Best practice is to use a server-side 301 (permanent) redirect as this is the only reliable method that works for SEO – helping search engines update your URLs, but what happens if you use other methods? Does the same thing happen in all browsers?

This is particularly important for URLs that are entry points on your site, as without original referrer data, you cannot know the source of sales and conversions on your site. Anyway, on to the results.

Redirect method Browser Result Impact on analytics
Meta refresh – 0 Firefox 3 Blank referrer Lost data
IE8 Blank referrer Lost data
Opera 9 Internal referrer Lost data
Javascript:location.href Firefox 3 Internal referrer Lost data
IE8 Blank referrer Lost data
Opera 9 Internal referrer Lost data
Javascript:location.replace Firefox 3 Internal referrer Lost data
IE8 Blank referrer Lost data
Opera 9 Internal referrer Lost data
Server-side 301 Firefox 3 Original referrer
IE8 Original referrer
Opera 9 Original referrer
Server-side 302 Firefox 3 Original referrer
IE8 Original referrer
Opera 9 Original referrer
Server-side 301 – chained Firefox 3 Original referrer
IE8 Original referrer
Opera 9 Original referrer
Server-side 302 – chained Firefox 3 Original referrer
IE8 Original referrer
Opera 9 Original referrer


Conclusion

While there’s nothing too unexpected in the results, it’s clear that the only way to redirect visitors and have reliable web analytics data is to use a server-side redirect. No javascript or meta-based method works, in all cases resulting in an empty or internal referrer (which will misleadingly show up as bookmark/direct in most analytics packages). Interestingly, javascript and meta redirects can result in totally blank referrer data in some browsers.

Server-side methods worked across all major browser tested, and you can get away with chaining redirects together while still keeping the referrer data.

Get all our news & insights delivered straight to your inbox

Related articles

A football stadium similar to the venue for Betting on Sports Europe 2021

65 Takeaways from Betting on Sports Europe 2021

Betting on Sports Europe 2021 descended on Stamford Bridge last week. The Receptional team were in the dug outs taking notes. Here are our 65 takeaways from eight talks across the two days.

Read now

Valetta - the venue for iGaming NEXT 2021

34 Takeaways from iGaming NEXT, Valletta 2021

We hopped on a plane to Malta recently for iGaming NEXT, Valetta 2021. This year's theme was “Disrupt the Status Quo”, so it was fascinating to hear about the innovation going on in the industry. Here are our top takeaways from our five favourite talks.

Read now

The pier opposite the venue for BrightonSEO

112 Takeaways from BrightonSEO

BrightonSEO made a welcome return in real life in September 2021. Here are our takeaways, covering culture, PR, lead gen, SEO and social tips and stats.

Read now

Contact us

Call us on 01525 715 520 or complete the form below, and one of the team will get back to you.