使用通用分析,将数据发送/测试到测试配置文件的最佳实践是什么?
我在之前</head>
和以下内容中包含了跟踪代码段:
window['ga-disable-UA-XXXXXXXX-X'] = true;
ga('create', 'UA-XXXXXXXX-X', {
'cookieDomain': 'none'
});
ga('send', 'pageview');
使用通用分析,将数据发送/测试到测试配置文件的最佳实践是什么?
我在之前</head>
和以下内容中包含了跟踪代码段:
window['ga-disable-UA-XXXXXXXX-X'] = true;
ga('create', 'UA-XXXXXXXX-X', {
'cookieDomain': 'none'
});
ga('send', 'pageview');
我通常会通过在生产和暂存中始终保持相同的代码来处理这个问题(也就是删除代码片段的ga-disable
和cookieDomain
行)。然后我在 Google Analytics 中创建 2-5 个不同的视图并将它们过滤为:
^(www\.)?example\.com$
)test.example.com
)staging.example.com
)admin.example.com
)在 Profile >> Filters 下,有预定义的过滤器和自定义过滤器。对上述所有内容使用预定义的包含Traffic to the Domain
。