While Measurement Protocol for GA4 is still rather, well, rough, it can be used to augment existing collection quite nicely. Recently, I wrote an article that discussed the nuances of session attribution with Measurement Protocol. One of the pain points of any data ingestion setup is how to debug it. Measurement Protocol hits are not automatically surfaced in GA4’s DebugView. In this article, I’ll show you how to make those hits pop up in the debug stream.
In this article, I’ll try to clarify the understandably murky Measurement Protocol functionality in Google Analytics 4. Measurement Protocol is a way to send events to Google Analytics 4 directly from a machine capable of sending HTTP requests (such as a web server). It’s an alternative collection method to the client-side libraries of Google Tag and the Firebase SDK. Measurement Protocol in GA4 is very different from its predecessor in Universal Analytics.
One of the hard-and-fast rules in Google Analytics is that once hits have been collected and processed into your data properties, those hits are untouchable. This means that if you mistakenly collect duplicate or incorrect transactions, PII traffic, or referral spam, for example, it’s extremely difficult, if not downright impossible, to purge or change this data in Google Analytics. Another staple of Google Analytics’ strict schema is that displacing hits in time is also very difficult.
This is a really cool feature for Google Analytics data collection, of which I’ve heard very, very little buzz. It’s a way to debug any and all hits sent to the Google Analytics endpoint at https://www.google-analytics.com/collect. In all simplicity, you just need to copy the entire URL of the HTTP request to your clipboard, paste it into a web browser, and add /debug between the hostname and /collect.