GA4 Measurement Protocol: Python and TypeScript Libraries


November 20, 2020

Google Analytics recently released Measurement Protocol as an open alpha for their new Google Analytics (GA4) properties. Measurement Protocol allows you to send data to GA4 from anywhere that has a connection to the internet. We are excited to share our new libraries for Python and TypeScript/JavaScript

With measurement protocol, you can do all sorts of advanced implementations in a similar way to how we used to do it with Google Universal Analytics:

  • Integration with call-center systems -enabling reporting of customer website, app, and call center interactions within Google Analytics 
  • Accurate e-commerce reporting – rather than relying on frail client-side reporting, send data about transactions and item purchases from the back-end of your commerce systems when transactions are fully processed 
  • CRM integration – push data into Google Analytics when customer records are updated, creating a clear, comprehensive view of the customer lifecycle 
  • Subscription revenue measurement – one of the most challenging realities for digital measurement – solved with Universal Analytics – send recurring revenue data to Google Analytics and see a true, and growing view of customer lifetime and campaign value

We are excited about the additional capabilities GA4 provides for Measurement Protocol including the relaxed dispatching window, addition of secrets, and the adoption of the new event-driven data model. 

IMPORTANT NOTE ABOUT LIMITATIONS

As noted above, the new Measurement Protocol is currently an alpha release, so functionality may change and all of the issues mentioned are expected to be addressed as the product matures. Here are a few known limitations:

  • Firebase’s “automatic” events are currently reserved and will be rejected by the GA server when sent via Measurement Protocol. This makes it impossible to log a screen_view event, or a session_start, etc. This may result in certain reports looking very strange with the UI.
  • Note: Measurement Protocol has been built to append data to an existing client/App ID. If you create your own be aware the data will look strange in the UI, since you are currently unable to replicate the automated user engagement events.
  • DebugView is not currently supported.

For more information about the new Measurement Protocol, see Google’s official documentation. If you need any help or support with connected devices, Measurement Protocol, or Google Analytics 4 properties, you can reach out to our team at wecanhelp@adswerve.com.