Google Analytics: How to separate domains in reports?

╄→гoц情女王★ 提交于 2019-12-11 03:09:40

问题


I have one code on multiple websites. I want to see on which website users are currently.

Currently i have made it this way, but in reports i see only as "direct traffic" for all domains

Is it possible?

var cb=function(){
    var pageTracker = _gat._getTracker('UA-XXXXXXXX-XX');
    pageTracker._setDomainName(document.domain);
    pageTracker._setAllowLinker(true); // To track traffic across domains
    pageTracker._trackPageview();
}

if(!window._gat) {                    
    $.getScript(('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js',cb);
}
else {
    cb();
}

Maybe it's possible via custom variables?


回答1:


The code you included should allow you to separate domains in your reports. There are several ways to do this:

  1. Add new profiles for each of the domains (in addition to your main profile which would include both). You do this in the Admin tab under Profiles. The custom filter would use the Include filter type and a Filter Field of "Hostname" in which you specify each domain.
  2. Use the "Hostname" field to segment your reports into separate domains directly. This works in some of the standard reports as a Secondary Dimension criteria but the easiest way is to add "Hostname" as a dimension or filter criteria in a custom report.
  3. Create separate Advanced Segments for each domain by specifying that you want to create an Include segment with the dimension "Hostname".

The last two options above allow you to compare the two domains side by side in your reports.



来源:https://stackoverflow.com/questions/11017130/google-analytics-how-to-separate-domains-in-reports

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