Site is showing up as a referrer to its own domain in Google Analytics reports. Why?

帅比萌擦擦* 提交于 2020-01-01 06:05:29

问题


I am having two GA reporting problems with a site I manage that I am not sure how to solve:

  1. The site is showing up as a referrer to its own domain in GA reports.
  2. My goal completions (sales conversions on 3rd party off-domain ecommerce cart) are all showing the site's domain as "source" when I obviously want to see the true "referers" who are sending traffic that results in goal completions.

My thoughts on potential reasons why this could happening:

I am using absolute paths for internal links, like this:

<a href="http://example.com/contact.html">

as opposed to

<a href="/contact.html">

Could this be it? Users often do click around internally before they purchase.

Also, on several high traffic pages, I am using javascript history backlinks, like this ::

<a href="javascript: history.go(-1)">go back</a>

Lastly, I'm doing a 301 redirect on "add to cart" traffic clicks so that

http://example.com/add_to_cart

redirects to:

http://paymentprocessor.com/ugly_url/cart_page.html

(Although this is an external 3rd party domain, my GA code still fires there)

Any guesses why I am experiencing the issues stated at the top here? ... thank you to all you GA wizards.


UPDATE UPDATE UPDATE

Thanks Eduardo for the great answer.

Thought I might share that now for href text links to 3rd party ecomm site I am tracking events with jquery via class, so my _gaq.push to track both the click event and copy the cookie data over from my site to the third party site looks like this:

$('a.index_addtocart_smallest').click(function(){
    _gaq.push(['_trackEvent', 'Outbound Links', 'index_addtocart_smallest', 'buy_click'],['_link', 'ssl.thirdpartyecom.net/order/']);           
    });

And when I use the form action "add to cart" submit in the HTML look like this:

<form action="http://example.com/add_to_cart" method="post" onsubmit="that=this;_gaq.push(['_trackEvent','Outbound Links','index_big_buy_button', 'buy_click'],['_linkByPost', this]);setTimeout(function() { that.submit() }, 100);return false;">

... to track the event, and post the existing cookie to third party server, while adding a delay to the click to make sure it is captured by GA.

In my case I am using the asynchronous syntax for Tracking Between a Domain and a Sub-Directory on Another Domain: https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite#domainAndSubDirectory


回答1:


In your case it's very clear that the problem is with the cart. When you redirect the user to your cart domain he lands on a new domain and lose access to the cookies that he was using on your site. Because GA needs to create a new set of cookies on the cart site it also creates a new visitor id and a new visit, that visit will be a self referral because that's where the visitor is coming from from GA point of view.

Google Analytics keeps state on cookies, __utm*. So when changing domains we need to copy the cookies from the domain you are currently in to the domain you are moving to. The google analytics API offers some methods to implement this. This is often known as "cross-domain tracking" or "multiple domain tracking". Google Analytics documentation offers a good explanation on how to implement it. You can also search Stack Overflow for several questions related to cross-domain tracking, people seem to have a hard time getting it right.

You are free to use absolute or relative links, it makes no difference for Google Analytics at all.

Javascript redirects are usually ok. Even though there are cases where they certainly make things a little bit more difficult your use case of a back button is fine and should not be causing any problems at all. Of course if the javascript redirect changes the domain you are in you are back to the same issue and needs to implement cross-domain tracking.

Sometimes internal referrers are legitimate. One example of legit self referrals: When a user visits a page on your site and stay there for over 30 min, then navigates to a second page. In that case after the 30 minutes the visit expires and when he navigates to that second page a new visit is created. This new visit will be a self referral and the second page will be considered a landing page. That might seem odd at first, but this is a self referral and it's usually fine.



来源:https://stackoverflow.com/questions/12488523/site-is-showing-up-as-a-referrer-to-its-own-domain-in-google-analytics-reports

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!