简体   繁体   English

Google Analytics-跟踪子域,没有子域? (xyz.domain.com&domain.com)

[英]Google Analytics - Track subdomain AND no subdomain? (xyz.domain.com & domain.com)

When I added the filters to Google Analytics ( https://support.google.com/analytics/answer/7476333 ) to show the full hostname with the subdomain, no traffic was showing up when testing it out on just the primary domain (without www). 当我将过滤器添加到Google Analytics(分析)( https://support.google.com/analytics/answer/7476333 )以显示带有子域的完整主机名时,仅在主域上进行测试时,没有流量出现(没有万维网)。

What's the proper way to set up filters so that it tracks subdomains and domains without a subdomain? 设置过滤器以便跟踪子域和没有子域的域的正确方法是什么?

There is only one filter listed on the linked page. 链接页面上仅列出一个过滤器。 It is a commonly used filter and does not exclude data. 它是常用的过滤器,不排除数据。 It simply prepends the hostname to the requestURI in the GA reports. 它只是在GA报告中将主机名添加到requestURI之前。

If you are trying to track a subdomain of the primary domain and the primary domain, having tracking for the same Property on both with the cookieDomain set to auto (which it is by default)and the filter applied should be all that is needed. 如果您尝试跟踪主域和主域的子域,则必须在cookieDomain设置为auto的情况下(在默认情况下)跟踪两者的相同属性,并且只需要应用过滤器即可。

If you are trying to track a primary domain and subdomains of a different domain, then if you are are trying to preserve referral and session data across the two, then you will need tracking for the same Property on the primary and subdomains, configured for cross domain tracking setup as per the article and the filter applied. 如果您尝试跟踪另一个域的主域和子域,那么如果要跨这两个域保留引荐和会话数据,则需要在主域和子域上跟踪相同属性,并为跨域配置根据文章和应用的过滤器进行域跟踪设置。

One weird issue I have come across (and it happens really randomly without rhyme or reason), is a view not reporting data, until the Save button on the view settings page has been clicked. 我遇到的一个奇怪问题(它实际上是随机发生的,没有韵律或原因),是在单击视图设置页面上的“保存”按钮之前,该视图不报告数据。

Usually the three most common issues i see are: 通常,我看到的三个最常见的问题是:

1) Tracking for the same property as the primary domain not being installed on the subdomain(s) 1)跟踪与未安装在子域上的主域相同的属性

2) Tracking for multiple Properties being installed, setup with incorrect configuration for multiple trackers.. which can cause all hits from all trackers to get sent to just one Property instead of all Properties 2)跟踪正在安装的多个属性,设置了多个跟踪器的配置不正确..这可能导致所有跟踪器的所有匹配都发送到一个属性而不是所有属性

3) Incorrect filters applied or incorrect filter order. 3)应用了错误的过滤器或错误的过滤器顺序。 Filters run in the order they are applied/added to a view. 筛选器将按照其应用/添加到视图的顺序运行。 The order of the filters, needs to be set in the Filter table for the particular view. 需要在特定视图的“过滤器”表中设置过滤器的顺序。
Example of incorrect filters - 错误的过滤器示例-
a View with a hostname filter to include only the Primary domain hostname, that also has the above filter applied, will not show any data for the subdomain(s) only the primary domain. 具有主机名过滤器的视图仅包含主域主机名,并且也应用了上述过滤器,该视图将仅显示主域的子域的任何数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM