首页 > 解决方案 > 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?

enter image description here

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.

标签: google-analyticsgoogle-analytics-apigoogle-client

解决方案


该事件在浏览量之后触发,并且自定义维度与事件相关联,而不是与浏览量相关联。

要以这种方式发送自定义维度:

<!-- 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>

然后使用平面表格创建自定义报告,就像屏幕截图中的表格一样。


推荐阅读