本文介绍了Google Analytics(分析) - 跟踪多个网站(顶级域名)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有10个顶级域名,例如example1.com,example2.com,example3.com等,每个域都有自己独特的网站(不重定向)。我的目标是为所有10个网站设置一个Google Analytics(分析)帐户和一个网络媒体资源,向我显示所有网站合并指标的主档案(默认)以及每个网站的10个个人档案,以便将视图限制在该网站上。 ..就好像它拥有自己的Google Analytics帐户一样。经过大量研究和阅读后,我认为我需要做的就是将以下代码添加到每个网站:
< script type =text / javascript>
var _gaq = _gaq || [];
_gaq.push(['_ setAccount','UA-XXXXXXXX']);
_gaq.push(['_ setDomainName','example1.com']);
_gaq.push(['_ trackPageview']);
(function(){
var ga = document.createElement('script'); ga.type ='text / javascript'; ga.async = true;
ga .src =('https:'== document.location.protocol?'https:// ssl':'http:// www')+'.google-analytics.com / ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga,s);
})();
< / script>
每个网站上唯一会改变的地方是 _setDomainName
来匹配任何网站的地址,例如example2.com,example3.com等。
此外,一个网站实际上位于顶级域名(anothersite.example4.com)的子域中,所以我猜我会把它放在那个实例中的 _setDomainName
变量中(不管它是顶级域还是子域)。
有人可以证实我正确解释了这个吗?我错过了什么,如果我拥有所有10个网络媒体资源,并且希望以后为每个网站创建一个帐户,网站管理员只查看他们网站的指标?
一些过滤器:
这很重要因为过滤器必须准确无误,并且它们会影响所有传入数据。
不同的建议是添加多个跟踪器。追踪你的主人作为一个财产,并在他们自己的财产中的每个其他领域与他们自己的谷歌跟踪代码,如此:
_gaq.push(
['_setAccount','UA-XXXXX-1'],
['_trackPageview'],
['b._setAccount','UA-XXXXX-2 '],
['b._trackPageview']
);
这使得每个域都不会交叉授粉,除了所有数据都被转储的master属性。
创建另一个原始配置文件以保证安全。
在主的域名,所以你可以区分页面来自哪个域的报告。请参阅
现在您已经正确地封锁了所有内容,您可以将未经过滤的数据访问给每个网站管理员,而无需同时欺骗许多过滤器。
总结:
主属性:2个配置文件,master(过滤为包含域名)和原始(未过滤)
每个域的一个属性:每个域中有1个配置文件(没有过滤器)
在Google Analytics(分析)中单独或作为一个群组跟踪多个域名
I have 10 top-level domains e.g. example1.com, example2.com, example3.com, etc, and each domain has its own, unique website (not redirects). My goal is to have one Google Analytics account and one web property for all 10 websites, a master profile (the default) that shows me metrics of all websites combined, and 10 individual profiles for each website to limit the view to just that website... as if it had its own Google Analytics account. After much research and reading, I think I determined that all I would need to do is add the following code to each website:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXX']);
_gaq.push(['_setDomainName', 'example1.com']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
Where the only thing that would change on each website would be the _setDomainName
to match whatever the website's address is e.g. example2.com, example3.com, etc.
Also, one website is actually at a sub-domain of a top-level domain (anothersite.example4.com), so I'm guessing I'd put exactly that in the _setDomainName
variable in that instance (regardless of whether it's a top-level domain or sub-domain.
Can someone confirm that I interpreted this correctly? Am I missing anything and is this a good way to set that up if I own all 10 web properties and want to later create an account for each website administrator to view metrics for their website only?
解决方案
If you do it the way you suggested, you would have to set up some filters:
one on each of the 10 domains to filter just incoming data for that domain
one on the "master" profile that includes the domain name in the page URL to keep the pageviews from combining on like named pages across domains (i.e, example1.com/contact.html and example2.com/contact.html)
This is all in addition to a "raw" profile in case the filters cause complete data loss.
11 filters in total.
That's a lot to get right since filters must be exact and they affect all incoming data.
A different suggestion would be to add multiple trackers. Track your "master" as one property and each of the other domains on their own property with their own GA tracking code as such:
_gaq.push(
['_setAccount', 'UA-XXXXX-1'],
['_trackPageview'],
['b._setAccount', 'UA-XXXXX-2'],
['b._trackPageview']
);
This keeps every domain from cross pollinating another except for the "master" property where all the data gets dumped.
Create another "raw" profile of the "master" for safe keeping.
Put a filter on the "master" for domain name so you can distinguish which domain the page came from in the reports. See Modify your cross-domain profile with a filter to show the full domain in your content reports.
Now you have everything properly cordoned off, you can give access to the unfiltered data to each website administrator without having to fool with too many filters.
Summary:
Master property: 2 profiles, master (filtered to include domain name) and raw (unfiltered)
One property for each domain: 1 profile in each (no filters)
Tut on Tracking Multiple Domains Individually and as a Group in Google Analytics
这篇关于Google Analytics(分析) - 跟踪多个网站(顶级域名)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!