Reputation: 1629
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.
Upvotes: 1
Views: 2272
Reputation: 14179
The event is firing after the pageview and the custom dimension is associated with the event, not the pageview.
To to send custom dimension in this way:
<!-- 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>
Then create a custom report using a flat table, like those in your screenshot.
Upvotes: 1