Find your next open-source project

Search by name, purpose, or keyword — or paste a GitHub repository URL
All skills

google-analytics-data-api-basics

Enable the Analytics Data API and run a v1beta report querying metrics like activeUsers by city and date.

When to use it

You have a Google Analytics property ID and need a scripted report, but haven't set up API access or chosen valid dimensions and metrics.

For example

You say

Use google-analytics-data-api-basics to write a Python script that reports activeUsers and sessions by city and date for property 1234567 since May 1, 2026.

You get
  • Python report script
  • API enablement commands
  • ADC login command

How it works

  • Includes a checkCompatibility() example to test whether chosen dimensions and metrics can be queried together.
  • Lists commonly used dimensions and metrics such as city, date, activeUsers, and screenPageViews.

Before installing

Requires the Google Cloud CLI (gcloud) and a Google Cloud project with the Analytics Data API enabled; reports need Application Default Credentials with analytics.readonly scope.