Measurement Protocol: The Most Universal Aspect of Universal Analytics
When Google Universal Analytics launched officially in April 2014, much of what we already knew about Google Analytics stayed the same. Certainly, the syntax for pageview and event tracking had changed, custom variables were recast as custom dimensions, and certain code-level customizations (such as organic traffic sources were bubbled up as admin settings, but the basic mechanics of pageview and event tracking remained unchanged.
Tracking from Anywhere
So what were the changes in Universal Analytics? Cross-device tracking was an important new capability, but arguably, the most important – and the most universal – part of Universal Analytics was Measurement Protocol. This feature allows you to send hits (meaning bundles of Google Analytics field values) HTTP requests from any programmed, networked device or environment.
Understanding a Broader Spectrum of User Behavior
Measurement Protocol is fairly specialized, but use cases continue to emerge an evolve, providing opportunities to measure and understand a wider range of end-user experiences and the business effectiveness of our development efforts. If you’re tracking a website, you can use analytics.js, gtag.js, or Google Analytics tags deployed through Google Tag Manager. If you’re tracking an Android or iOS mobile app, you can add the Google Tag Manager library to your builds and tag accordingly.
You can use Measurement Protocol for scenarios in which the previous options do not apply, such as:
- point-of-sale transactions (with potential joins to online campaigns and interactions)
- tracking a Windows or BlackBerry mobile app
- desktop applications
- measuring user interactions with a kiosk in a public space, such as an airport or a shopping mall
- tracking a gaming environment
- server-to-server (tracking API calls, as an example)
Building the Hit Yourself
The main task required in Measurement Protocol is building the hit yourself. Each time you send a Measurement Protocol hit to Google Analytics, you’re specifying all the parameters yourself. To assist, we’re offering a Measurement Protocol parameter reference in easy-to-use table format.
Required and Recommended
This reference includes a Best Practice column that indicates if the parameter is recommended to pass when available, even if it is not required.
There are many parameters that, if left out, create various issues with eventual visualization in the Google Analytics Web reporting interface.
As a note about HitBuilder, you can use the the tool to validate the format of the Measurement Protocol hits that you intend to send, but you’ll construct the actual hits programmatically in real time, not through HitBuilder.
Any Measurement Protocol stories you’d like to share? Any questions, we welcome you to use the comments below. And please let us know if our engineers can assist with your next Measurement Protocol tracking challenge.