Skip to content

Google Analytics Data API Basics

Lets the agent enable the GA Data API, set up auth, and write report queries for GA4 properties.

Repository
google/skills
Stars
21,782
Licence
Apache-2.0
Files
8 files

What it does

When this skill is installed, the agent knows how to set up access to the Google Analytics Data API (v1beta) for a Google Cloud project: it can run gcloud commands to enable the API and check it is enabled, walk you through Application Default Credentials login, and pick the right client library guide for your language. It can also write a working Python script that pulls active users and sessions by city and date from a GA property, and it checks that dimension and metric names are valid. It does not manage GA properties, users or tracking code.

Great for

  • Developers building a dashboard or automated report that pulls GA4 data
  • Analysts who want a starting script to query a GA property from Python, Java, Node.js, Go, .NET, PHP or Ruby
  • Teams who need the gcloud setup steps for the Analytics Data API

Skip it if

  • Creating or managing GA properties, users or permissions: the skill explicitly excludes the Admin API
  • Installing website tracking tags: the skill excludes front-end tracking, so it will not help with that
  • Anyone expecting a no-setup tool: it needs a Google Cloud project, gcloud, and an account with access to the GA property

Try asking

  • “Enable the Analytics Data API in my Cloud project and confirm it worked”
  • “Write a Python script that shows active users and sessions by city and date for property 1234567”
  • “Which dimensions and metrics can I combine in a GA4 report?”
  • “Set up Application Default Credentials so my Node.js app can call the GA Data API”
Step-by-step guide: how to use Google Analytics Data API BasicsInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 8 original files, the Apache-2.0 licence and an attribution note.

    google-analytics-data-api-basics.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip google-analytics-data-api-basics.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip google-analytics-data-api-basics.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Expect the agent to run gcloud commands that change your Cloud project (enabling the API), so review them before approving.
  • Keep the ADC login scoped to read-only analytics access and use your own account rather than shared credentials.
  • Give the agent your property ID and the exact dimensions and metrics you want, so it can build a precise RunReportRequest.

What's inside

  • references/dotnet.md
  • references/go.md
  • references/java.md
  • references/nodejs.md
  • references/php.md
  • references/python.md
  • references/ruby.md
  • SKILL.md

Redistributed unmodified from google/skills under the Apache-2.0 licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.