Archive UA data before Google deletes it using automated export using the API.
Set up Google Analytics Reporting API keys, send a UA data request, and format the JSON response into a usable dataframe.
This video is about Universal Analytics (UA). GA4 python API video - https://youtu.be/HbxIXEfl-Hs
GitHub repository:
https://github.com/tanyazyabkina/GoogleAnalyticsReportingAPI_python
If you need to archive your UA data, this is the updated code that has pagination support:
https://github.com/tanyazyabkina/Archive_Google_Analytics_UA_data/
Google reference:
https://cloud.google.com/resource-manager/docs/creating-managing-projects
https://developers.google.com/analytics/devguides/reporting/core/v4
https://ga-dev-tools.appspot.com/dimensions-metrics-explorer/
https://ga-dev-tools.appspot.com/request-composer/
Chapters:
0:00 Introduction
1:00 Set up Google Analytics Reporting API access
5:56 Code demo
12:21 Code deep dive, how it works
15:42 Visualization example 1
17:21 Data validation demo
21:21 Visualization example 2
If you have questions, you can contact me here:
https://probabilistically.com/contact