Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing on the HTTP referrer (Site A, B, C - A to C)?

This is a question best illustrated by example:

User goes to Site A, and clicks through to Site B. The referring site is now Site A. The same user clicks through to Site C from Site B. The referring site is now Site B.

I'm wondering if it's possible to have the referring site for Site C show up as Site A (the initial referrer if you will).

Why I'd like this (a bit more context)?

I'm using a targeting software (Site B) that'll redirect to the true destination (Site C). Because I'll be linking to this targeting software instead of the final destination, Google Analytics will register all referrals as the targeting software which will completely defeat the purpose of tracking referring sites.

I'd like to be able to pass the in "actual" referrer (Site A) in order to see where visits to Site C actually coming from.

If possible I'd like to do this without "hacks" or "workarounds" which have the potential to break easily.

like image 709
Avicinnian Avatar asked Apr 02 '12 15:04

Avicinnian


People also ask

What is a referral traffic source?

Referral traffic is the segment of traffic that arrives on your website through another source, like through a link on another domain.

What does direct referral mean in Google Analytics?

'Direct' can also refer to the visitors who clicked on the links from their bookmarks/favorites, untagged links within emails, or links from documents that don't include tracking variables (such as PDFs or Word documents). [referral] - Visitors referred by links on other websites.

How do I create a referral path in Google Analytics?

These specific pages are known as referral paths. To see this information in Google Analytics, head to Traffic Sources in the navigation menu. Under Traffic Sources, you'll see Referrals. Set the Primary Source to Referral Path to view the pages.

How do I see referral traffic in Google Analytics?

To view Referrals, go to Acquisition > All Traffic > Referrals. Once here, you'll see a list of the sites that referred traffic to your site, sorted by Session volume. You can see metrics for the volume of traffic, engagement, and conversion performance.


1 Answers

See _setReferrerOveride:

_setReferrerOverride()

_setReferrerOverride(newReferrerUrl) Sets the referrer URL used to determine campaign tracking values. Use this method to allow gadgets within an iFrame to track referrals correctly. By default, campaign tracking uses the document.referrer property to determine the referrer URL, which is passed in the utmr parameter of the GIF request. However, you can over-ride this parameter with your own value. For example, if you set the new referrer to http://www.google.com/search?hl=en&q=hats, the campaign cookie stores a new campaign with source=google, medium=organic, and keyword=hats.

_gaq.push(['_setReferrerOverride', 'URL-YOU-WANT-AS-REFERRER']);

It may still work whether you are using an iframe or not. Worth a try and not a hack.

like image 178
jk. Avatar answered Nov 15 '22 06:11

jk.