Google Analytics showing 301 redirect as referral

寵の児 提交于 2019-12-11 23:48:01

问题


I have universal analytics installed on my site. The .htaccess file does a location-based 301 redirect. Here is what happens:

www.mysite.com redirects to www.mysite.com/uk if the user is based in the UK. The same happens for .fr and .de.

In analytics I have added mysite.com to the referral exclusion list however analytics is still putting out mysite.com as the referrer for my traffic.

Here's my GA snippet:

    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-12345678-1', 'mysite.com');
  ga('send', 'pageview');

The create event part was set to 'auto' instead of specifically naming the domain as it is above, however that made no difference.

I've asked many people and many experts and none have the solution. Any help out there?

来源:https://stackoverflow.com/questions/27984238/google-analytics-showing-301-redirect-as-referral

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