-
Discrepancies in Google Analytics 4 UI and Google Data API Analytics
Hey there, I’m using the GA4 customer list and the google API analytics for GA4 to grab my daily traffic metrics for reports.
I’ve been keeping an eye on things day-to-day and there’s something a bit fishy going on. The metrics I’m getting from the GA UI web and the google API are quite different.
At first I thought I’ve messed up something in my pipeline or am doing something wrong. But even when I tried THE SAME REQUEST as per runReport from the official google guide using the property id and JSON request body:
{ "dimensions": [ { "name": "date" }, { "name": "deviceCategory" }, { "name": "hostName" }, { "name": "pagePathPlusQueryString" }, { "name": "pageTitle" }, { "name": "sessionDefaultChannelGrouping" } ], "metrics": [ { "name": "engagedSessions" }, { "name": "newUsers" }, { "name": "screenPageViews" }, { "name": "sessions" }, { "name": "userEngagementDuration" } ], "dateRanges": [ { "startDate": "yesterday", "endDate": "yesterday" } ], "metricAggregations": [ "TOTAL" ] }
I’m still getting the same results!
What I’ve noticed was that the “PagePathPlusQueryString”, “pagePath” and “pageTitle” dimensions in the API RunReportRequest are giving me higher and incorrect values. If I remove these dimensions, everything lines up perfectly between the GA API and Google Analytics Web UI.
I’ve searched high and low, but I haven’t found any limitations or guidelines that say these dimensions need to be included in a request. So, I’m stumped as to why this is happening and why I’m getting the wrong values.
I could really use some help figuring this out. Any ideas?
Log in to reply.