Google Analytics: Track two domains as one

本秂侑毒 提交于 2019-12-11 07:22:29

问题


At work we have two domains that serve the exact same website/code/etc. I'm trying to find out if there is a way to track them through Google Analytics and have a single account that could not care less which domain it's serving analytics data for? The issue that I have currently is that the domain that we use for advertising is showing up as a referrer which is hiding (or at least I don't know how to find) what the true source was (google/bing/yahoo/etc).

Please note... After searching on here I just wanted to add this to hopefully make it 100% clear. I don't want to track the two domains individually...I want my GA account to merge the data without regard to what domain the users browser shows.


回答1:


Why would you want that anyways?

Having 2 domains serve the same content could be counted as duplicate content and could screw up your google ranking. I advice to redirect one domain to the other so 1 domain actually handles the website and the other just catches visitors.

If you would like to do it anyways

var pageTracker = _gat._getTracker("UA-12345-1");
pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);
pageTracker._trackPageview();

But you also need to edit all your links, read the article below.

http://support.google.com/googleanalytics/bin/answer.py?hl=en&answer=55503



来源:https://stackoverflow.com/questions/10133880/google-analytics-track-two-domains-as-one

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