Generate a GA4 Data API Report using OAuth2 and Python

Pia Riachi
3 min readNov 23, 2023
Photo by Justin Morgan on Unsplash

The Google Analytics 4 (GA4) Data API provides a robust toolkit for extracting valuable insights from your website or app’s analytics data.

In this post, we’ll embark on a journey to generate GA4 Data API reports using OAuth2 and Python. While the default connection method involves adding a service account to Google Analytics, this approach may not always align with your…

--

--

Pia Riachi

Engineer @Google | Advertising Solutions Engineering | Business Intelligence | Data Engineering