我在哪里可以找到通过Google Analytics(分析)信息中心的gtag配置传递的自定义键/值对?
例如,我要在此处通过键customKey
过滤数据:
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'XXXXXX', {'customKey': 'value'});
</script>
最佳答案
实际上似乎是the reference only discusses briefly the commands(event
,config
,set
)。
大多数实际的customKey
选项似乎都在每个主题的Guide's Advanced Tracking section(请参见左侧边栏)下进行了讨论。例如:
Cookies and user identification
gtag('config', 'GA_TRACKING_ID', {
'cookie_name': 'gaCookie',
'cookie_domain': 'blog.example.co.uk',
'cookie_expires': 2419200 // 28 days, in seconds
});
Custom dimensions and metrics
gtag('config', 'GA_TRACKING_ID', {
'custom_map': {'dimension<Index>': 'dimension_name'}
});
IP anonymization
gtag('config', 'GA_TRACKING_ID', { 'anonymize_ip': true });
等等...
关于google-analytics - Google Analytics(分析)gtag在哪里可以找到自定义配置键值对,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47411842/