在新的 Google Analytics 用户界面中管理子域
我有以下域结构:
mydomain.com
www.mydomain.com
site1.mydomain.com
site2.mydomain.com
我需要什么:
- 一个将所有这些域的所有流量作为一个整体
- 报告的配置文件 仅报告流量的配置文件对于 mydomain.com 和 www.mydomain.com 作为一个(它们实际上是相同的服务器别名,只是用户偏好是否使用 www,所以我想将两者合并在一起)
- 一个仅报告流量的配置文件site1.mydomain.com
- a配置文件仅报告 site2.mydomain.com 的流量
这些网站本质上是一个 Web 应用程序的一部分,因此我只想使用一个跟踪代码。
我对 GA 还很陌生,所以我在网上查看了一些教程,但大多数都已经过时,并且屏幕截图来自旧的 GA 用户界面。甚至谷歌帮助文档似乎也有点过时了,所以我对如何以干净的方式设置一切感到困惑。
到目前为止我所拥有的:我为 mydomain.com 创建了一个帐户。我选择了此跟踪代码适用于“具有多个子域的一个域”的单选选项,Google 为我提供了以下跟踪代码:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-12345678-1']);
_gaq.push(['_setDomainName', 'mydomain.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>
注意:mydomain.com 之前没有点。有些网络教程说,它应该在那里,有些教程说可以不加点。
Google 创建了个人资料: mydomain.com [默认] 为我。
现在,我可以按主机名单独查看流量(技术 -> 网络,然后单击图表下方表格中的主机名),但我希望更轻松地访问主机名过滤器,因此当我单击个人资料名称。
我尝试创建一个新的配置文件 site1.mydomain.com 并添加了一个过滤器: 预定义过滤器 仅包括 ->来自域的流量 ->等于 -> site1.mydomain.com 该过滤器出现在该配置文件的过滤器列表中,但当我打开报告时,我仍然看到所有流量,包括 mydomain.com 和 site1.mydomain.com。
使用新的 Google Analytics 用户界面设置满足我需求的配置文件的最直接方法是什么?
I have the following domain structure:
mydomain.com
www.mydomain.com
site1.mydomain.com
site2.mydomain.com
What I need:
- a profile to report all the traffic for all these domains together as one
- a profile to report only the traffic for mydomain.com and www.mydomain.com as one (they actually are the same server alias, just a user preference whether use or not use the www, so I would like to merge both together)
- a profile to report only the traffic for site1.mydomain.com
- a profile to report only the traffic for site2.mydomain.com
Those sites are essentially a part of one web application, so I would like to use only a single tracking code.
I am pretty new to GA, so I have looked some tutorials on the web, but mostly they are outdated and screenshots are from older GA user interface. Even Google Help documentation seems to be a bit outdated, so I am confused about how to set up everything in a clean way.
What I have so far: I created an account for mydomain.com. I selected the radio option that this tracking code is for "One domain with multiple subdomains" and Google gave me the following tracking code:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-12345678-1']);
_gaq.push(['_setDomainName', 'mydomain.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>
NOTICE: there is no dot before mydomain.com. Some web tutorials say, it should be there and some tutorials say that it is ok to leave it without the dot.
Google has created a profile:
mydomain.com [DEFAULT]
for me.
Now I am able to see the traffic separately by Hostname (Technology -> Network, and click Hostname in the table below the chart), but I would like to have a easier access to the Hostname filter, so they are already applied when I click on the profile name.
I tried to create a new profile site1.mydomain.com and added a filter:
Predefined filter
Include only -> traffic from the domains -> that are equal to -> site1.mydomain.com
The filter appeared at the filters list for that profile, but still when I open the report, I see all the traffic together, including mydomain.com and site1.mydomain.com.
What would be the most straight forward way to set up the profiles for my needs using the new Google Analytics User Interface?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先,我会规范化您的默认网站 URL(对于所有人(或没有人)使用“www.”) - 出于 SEO 原因(http://www. mattcutts.com/blog/seo-advice-url-canonicalization/)。
现在回答:
放置点“.”的原因您的 _setDomainName(例如“.mydomain.com”)上的 Cookie 的作用是让 Cookie 可供子域中的访问者使用。
这意味着访问“site1.mydomain.com”然后访问“www.mydomain.com”将被视为同一访问。
因此,如果没有点,一旦访问者更改子域,您的“获取全部”配置文件就会重复访问。
(更多信息请参见:http://code.google.com/intl/en/apis/analytics/docs/gaJS/gaJSApiDomainDirectory.html#_gat.GA_Tracker_._setDomainName)
关于过滤器,而不是预定义的过滤器,尝试为主机名创建包含的自定义过滤器。然后对于模式,您将创建一个类似于^site1\.mydomain\.com$的正则表达式
希望它有帮助!
First off, i'd canonicalize your default website URL (with "www." for everyone (or no one)) - for SEO reasons (http://www.mattcutts.com/blog/seo-advice-url-canonicalization/).
Now to the answer:
The reason to place the DOT "." on your _setDomainName (like '.mydomain.com') is to leave the cookies available for the visitors across your subdomains.
That means that one visiting "site1.mydomain.com" and then going to "www.mydomain.com" would be treated as the same visit.
Hence, without the dot, you would get duplicate visits on your "get all" profile, once a visitor changes subdomains.
(more on that here: http://code.google.com/intl/en/apis/analytics/docs/gaJS/gaJSApiDomainDirectory.html#_gat.GA_Tracker_._setDomainName)
About the filter, instead of a Predefined Filter, try creating a Custom Filter of Include for the Hostname. Then for the pattern you'd create a Regex looking something like ^site1\.mydomain\.com$
Hope it helps!!
您应该设置一个过滤器来在您的主配置文件中添加主机名,比较子域
,然后为每个站点设置一个配置文件,仅过滤该子域上的流量,
如果您没有 2 个字母的域 xx.com,那么您将不会有 IE 流量,仅限其他浏览器。我遇到了这个问题,并且无法在不弄乱网站上 150-190 个子域的情况下解决:)
rgds
you should setup a filter to add hostname in your main profile, that compares subdomains
then setup a profile for each site, filter only traffic on that subdomain
just prey you dont have a 2-letter domain xx.com, then you wont have IE traffic, only the other browsers. I have that issue, and cant solve without messing up my 150-190 subdomains on the site :)
rgds