gpt4 book ai didi

angular - gtag 自定义维度未被 Google Analytics(分析)拾取

转载 作者:太空狗 更新时间:2023-10-29 19:32:25 28 4
gpt4 key购买 nike

我正在尝试使用 Angular4 和 Google Analytics 集成自定义维度。我看过类似的主题,但没有任何内容可以准确解决这个问题。

在 GA 中我设置了自定义维度:

enter image description here

它以索引 1 显示:

enter image description here

index.html 我有:

  <script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxx-xxxxx"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-xxxxx-xxxxx', {
'custom_map': {
'dimension1': 'userType'
}
});
</script>

然后在 app.component.ts 中,我使用路由器事件获取页面位置并传递用户类型:

this.router.events.subscribe(event => {
if (event instanceof NavigationEnd) {

(<any>window).gtag('event', 'pageView', {
'page_path': event.urlAfterRedirects,
'userType': 1
});

}
});

当我访问该网站时,我在 GA 的实时区域中看到页面浏览量:

enter image description here

我也在事件中看到了事件:

enter image description here

我可以看到自定义维度正在 Chrome 开发者控制台的“网络”中的 QueryString 参数中发送:

v: 1
_v: j69
a: xxxxxxxx
t: event
_s: 10
dl: http://localhost/
dp: /member/dashboard <<<<<<<<<<<<<<<<<<<<<<<<<<< page_path
ul: en
de: UTF-8
dt: xxxxxxx
sd: 24-bit
sr: 1920x1200
vp: 1189x1073
je: 0
ec: general
ea: pageView <<<<<<<<<<<<<<<<<<<<<<<<<<< EVENT NAME
_u: xxxxx~
jid:
gjid:
cid: xxxx
tid: UA-xxxxx-xxxxx
_gid: xxxxxxx
gtm: u9h
cd1: 1 <<<<<<<<<<<<<<<<<<<<<<<<<<< CUSTOM DIMENSION
z: 1516445861

我已经设置了一个自定义报告来过滤 userType 1 的所有用户:

enter image description here

但是,没有任何显示。

知道我做错了什么吗?谢谢!

最佳答案

如@Ms.Easy 所述,对此的回答只是“在标准帐户中,GA 数据延迟大约为 24 小时”。

关于angular - gtag 自定义维度未被 Google Analytics(分析)拾取,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52548707/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com