Skip to content
Projets

tanyazyabkina/GA4_API_python has 29 GitHub stars and 7 forks. GitHot measured 0 stars in 24 hours, 0 in 7 days, and 0 in 15 days. Last checked 2026-11-13 06:59 UTC. Last push 2025-02-08.

Comment ces chiffres sont mesurés

Download GA4 data summaries using Google Analytics Data API and python

Progression mesurée des étoiles

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

Google Analytics 4 (GA4) Data API with Python

Important links:

  1. Google Quickstart guide: https://developers.google.com/analytics/devguides/reporting/data/v1/quickstart-client-libraries
  2. API dimensions and metrics: https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema
  3. Google developer's guides: https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties https://googleapis.dev/python/analyticsdata/latest/data_v1beta/beta_analytics_data.html

Blog post with detailed instructions: https://probabilistically.com/ga4-bigquery-backfill/

The overview of the process:

  1. Get API keys: create a GCP project, authorize Google Analytics Data API, create a service account, create JSON keys for the account.
  2. Add service account as a viewer to your GA4 propert(Admin->User Management)
  3. Install google-analytics-data package.
  4. Set os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = 'your_api_key.json'
  5. Send request, get output. Done!

If you have trouble installing/importing Google Analytics data in your environment, run the code on Google Colab. The JSON would need to be saved as the key

Explorer des projets similaires