Google Analytics 4 API: First Impressions

A lot of us have enabled the new Google Analytics 4 tracking in parallel to our GA (Universal Analytics) implementation, and are in the ‘playing around mode’. With the latest update of the Analytics Edge connector for Google Analytics (Pro), you can now access the new Data API (v1alpha) — available as “GA 4 Reporting”. This is just my initial OMG reaction to reporting with the new API…things have changed.

First of all, the new APIs (there are several) are clearly labelled ‘v1alpha’ and subject to change as usage and deployment broaden. There are currently 149 dimensions and metrics available, provided as one big list and not a lot of explanation. To someone used to Universal Analytics reporting of a website, it will be very confusing. A simple example: “Medium” can now be found in 3 dimensions:

  • medium – The medium attributed to the conversion event.
  • sessionMedium – The medium that initiated a session on your website or app.
  • firstUserMedium – The medium that first acquired the user to your website or app.

Then there are some definitions that probably make sense if you already understand what they mean, like Total Users:

  • totalUsers – The number of distinct users who have logged at least one event, regardless of whether the site or app was in use when that event was logged.

I know a lot of people will ask “how do you log an event with out using the site or app”? Of course there is also active users:

  • activeUsers – The number of distinct users who visited your site or app.

Maybe all this makes more sense in the mobile app space than in the website space, or by the fact that the data can include traffic from both.

As for reporting, as with Universal Analytics, try to mimic the web interface when selecting dimensions and metrics and you should be OK. One hint: if you are looking for ‘pageviews’, use Event Count with a filter for Event Name equals ‘page_view’, or you can pivot the Event Name to see all the events for each page like this:

I included a couple of Universal Analytics queries of the same property so you can see the numbers are similar, but don’t try to get them to match…and that raises all kinds of questions I won’t get into just yet.

This is, after all, just an initial reaction…


Mike Sullivan


P.S. on top of everything else, GA (Universal Analytics) had a Reporting API v2, V3 and V4, and now Google Analytics 4 uses the Data API v1. The Management API has been replaced with a new Admin API, and the Measurement Protocol has be supplanted by the Measurement Protocol (Google Analytics 4). Oh, and the Metadata API functionality is now included in the Data API because customer events can be property-specific. Nothing like a little change to start 2021…