google-analytics - Google Analytics Users but no Pageviews?
问题描述
I'm using a custom dimension to view metrics by a page ID.
If I query metrics ga:users
and ga:pageviews
using my dimension ga:dimension3
I'll get something like 20 users and 0 pageviews.
I think this is because a user
gets counted regardless of which page they visit — but it makes this metric meaningless if I'm trying to understand metrics for a specific page.
How can I query useful metrics for a single page? Are there other metrics I should be looking at? Or perhaps a different way to form the query to return more relevant per-page metrics?
Update
I'm using gtag.js and my dimension has a scope of hit
. Here's what I'm sending:
window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-XXXXXXXXX-1', {"custom_map":{"dimension3":"pageid"}});
gtag('event', 'pageid_event', { 'pageid': 123 });
Am I doing something wrong here? I thought config
was enough to send a pageview, but the docs make it sound like I need an event too.
解决方案
该事件在浏览量之后触发,并且自定义维度与事件相关联,而不是与浏览量相关联。
要以这种方式发送自定义维度:
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GA_TRACKING_ID',{
"dimension13": "123"
});
</script>
然后使用平面表格创建自定义报告,就像屏幕截图中的表格一样。
推荐阅读
- authentication - nuxt-auth 登录后设置用户对象
- android - 我正在尝试构建 apk,但我在 react-native 中收到此错误
- html - 不同浏览器中复选框/单选按钮的显示问题
- c# - 如何
用新行中的特定元素替换多个标签? - python - 使用 base64ImageField 和嵌套序列化程序时在 POST 方法中返回 URL
- youtube-api - 如何从嵌入的 youtube 视频中删除分享和观看信?
- iis - Windows 服务器中 IIS 上的 Asp NET Core 2.2 问题
- java - 有没有办法强制使用 JMS 消息选择器?
- sip - kamailio 隐私标头和取消
- angular - Angular:在更改另一个表单控件时触发表单控件验证