自定义谷歌分析维度不显示在仪表板上



我使用以下代码在Angular中设置自定义的google分析维度:

var date_enrolled = '11/11/2021 11:59 AM';
gtag('config', 'UA-XXXXXXX', { 'enrollment_date':  date_enrolled});

我在我的localhost:4200上运行这个。当我转到localhost:4200/emp页面时,就会调用这段代码。现在在谷歌分析(从浏览器)我遵循这个url:

https://support.google.com/analytics/answer/2709829?hl=en& ref_topic = 2709827 #生机勃勃的= % 2 cin-this-article

并创建了一个自定义维度。但是,当我将自定义维度添加到其中一个洞察时,它不会显示任何记录。你能告诉我这里可能遗漏了什么吗?

要向Google Analytics发送自定义维度,请更新属性的配置以设置维度的custom_map参数,然后使用自定义参数发送自定义维度的值:

// Configures custom dimension<Index> to use the custom parameter
// 'dimension_name' for 'GA_MEASUREMENT_ID', where <Index> is a number
// representing the index of the custom dimension.
gtag('config', 'GA_MEASUREMENT_ID', {
'custom_map': {'dimension<Index>': 'dimension_name'}
});
// Sends the custom dimension to Google Analytics.
gtag('event', 'any_event_name', {'dimension_name': dimension_value});

最新更新