The shit show of Google Analytics 4 (GA4), the Analytics Data API, and the retirement of Universal Analytics and the Reporting API

Posted on Sat 26 November 2022 in IT, programming, google

Early in 2022, I started getting emails from Google, warning that starting from 2023 they would retire Universal Analytics (UA), which is what everybody uses to track views from Google Analytics in this decade. Closer inspection revealed that this was not a simple change: they were in fact retiring all UA properties, together with the Google Analytics Reporting API we so far used to query data from them. The future, they said, was Google Analytics 4 (GA4). I have never seen a change of this magnitude being deployed in such a sloppy way. I do not even know where to begin from, so I will just have a bullet list before my head bursts with frustration.

  • There is no way to migrate a UA property to a new GA4 property. You can not bring your historical, decade old data into the modern properties. You simply, marvelously, wonderfully lose them. Quoting from them: "If you have a Universal Analytics property, you must migrate. The earlier you migrate, the more historical data and insights you will have in Google Analytics 4."
    Honestly, if you are going to lose all your previous data (and you are), you might as well ditch Analytics altogether and move to the more open, possibly self-hosted Matomo.
  • The libraries for the new Analytics Data API are still in beta. More and more people are being pushed into creating a GA4 property, and we do not even have a reliable way of pulling data out of it. I have loads of customers coming to me asking when our product will support GA4, or, even worse, saying that they cannot use our product because they only have a GA4 property. I cannot even articulate how ridiculous it is that GA4 has been live for what, a year? And we are still without stable libraries. I am not going to put in implementation work on a beta, let alone ship it to customers in production.
  • The migration guide is a joke. No common login flows, no use cases examples, a flood of broken links.
  • The GA4 PHP library does not even have an example with Oauth2. They only have examples with service accounts which, frankly, I do not even know who will use. Then there comes some saint submitting a PR with the Oauth2 example, and the only comment he receives is that the specific repo he submitted it against does not accept pull requests. We do not even get a Google employee saying "thank you, I will re-submit it against the right one" ... it just gets closed. Good luck figuring out which of the million repos you should be looking at, anyway.
  • GA4 properties can not be linked to Adsense. As it looks right now, UA properties linked to Adsense were the only way to obtain a report of what pages generated how much revenue. Unless I will be proven wrong, there will be no way to generate a view of page paths <-> revenue. I am bewildered that nobody at Google thought about this use case, and I am not alone.
  • The GA4 PHP library relies on protobuf, which requires php-bcmath, which is not included by default in PHP installations. A loads of broken clients. Sure, not strictly a GA4 requirement, but maybe worth checking how common newly-required dependencies are? Google acknowledged this in 2019, and has taken no action so far.
  • There seems to be some weird interference between GA4 properties and UA properties. I received reports of customers having both of them in the same account, saying that their authentication gets invalidated every few days. It did not use to happen before, and only happens for people who have some GA4 properties.

And do not even get me started on the whole choice of having a new API. What is the benefit for customers? Probably negligible. What is the hassle? Gigantic. You wanna put out a new API? Great, but leave the old one alone. They deliver a breaking change that is going to affect millions of websites, and 6 months from the retirement of the Reporting API the do not even have the libraries out of beta, they require to largely revisit current implementations, and the documentation is incomplete and littered with 404s? What company is this, I do not know.