Skip to content

Guide · Agent skill

How to use the Google Analytics Admin API Basics agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The google-analytics-admin-api-basics skill gives an AI agent working knowledge of the Google Analytics Admin API, the interface used to configure Google Analytics accounts and properties rather than read reports. It is aimed at developers and analytics engineers who automate setup, such as provisioning properties or data streams. By the end of this guide you will know how to install the skill, what it needs before it can make calls, and how to ask the agent for configuration work.

Google Analytics Admin API Basicsgoogle/skills · Apache-2.0

Quick start

  1. 1Download and unzip. Download the skill ZIP from this page and unzip it into ~/.claude/skills/ or your project's .claude/skills/ folder.
  2. 2Install gcloud. Install the Google Cloud CLI if gcloud is not already available on your machine.
  3. 3Enable the API. Run gcloud services enable analyticsadmin.googleapis.com --quiet in your Google Cloud project, then confirm with gcloud services list.
  4. 4Set up credentials. Run gcloud auth application-default login with the cloud-platform and analytics.readonly scopes, adding analytics.edit for configuration changes.
  5. 5Install a client library. Name your language in the request so the agent reads its setup guide, then install the package, such as pip install google-analytics-admin for Python.
  6. 6Ask for the task. Describe the configuration task in plain language and review the commands before they run.

What is an agent skill and what does this one do?

An agent skill is a folder of instructions and reference files that an AI agent loads when a task matches the skill's description. This skill's main file, SKILL.md, tells the agent how to enable the Admin API in a Google Cloud project, set up sign-in credentials, list accounts and properties, and manage settings such as data streams, custom dimensions, conversion events, data retention, and Firebase or Google Ads links.

The skill also points the agent to per-language setup guides in a references folder for Python, Java, PHP, Node.js, Go, .NET and Ruby. When you name a language, the agent is directed to read the matching guide before installing the client library.

Install the skill from the download ZIP

Download the ZIP for this skill from this page and unzip it. You have two places to put the folder. For a personal setup, place it in ~/.claude/skills/. For a single project, place it in that project's .claude/skills/ folder. Either way, the folder should contain SKILL.md and the references folder.

If you use the Claude apps instead, you can upload the skill under Settings → Capabilities → Skills.

  • Personal: ~/.claude/skills/google-analytics-admin-api-basics/
  • Project: .claude/skills/google-analytics-admin-api-basics/
  • Claude apps: Settings → Capabilities → Skills

Prepare Google Cloud before the agent makes calls

Before any API call, the Analytics Admin API must be enabled in your Google Cloud project. The skill has the agent run the gcloud command below. If gcloud is not installed, the agent will ask you to install the Google Cloud CLI first. You can then check that the API is enabled.

Authentication uses Application Default Credentials. The skill's login command requests the Cloud Platform scope and the analytics.readonly scope. Methods that change account or property configuration need the analytics.edit scope instead.

  • Read-only access uses analytics.readonly.
  • Configuration changes need analytics.edit.
gcloud services enable analyticsadmin.googleapis.com --quiet gcloud services list --enabled --filter="analyticsadmin.googleapis.com" gcloud auth application-default login --scopes="https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/analytics.readonly"

Trigger the skill with a natural request

You do not need a special command. Describe the configuration task in plain language and mention Google Analytics setup. The skill's description covers account and property configuration, data streams, custom dimensions, conversion events, retention, measurement protocol secrets, and Firebase or Google Ads links, so requests on those topics are the ones it is meant to handle.

Name the language you want, such as Python or Go, so the agent reads the right setup reference.

  • Example: "List all my Google Analytics accounts and properties using Python."
  • Example: "Set up a Node.js script that creates a web data stream on property 123456."
  • Example: "Show me how to change data retention on a property with the Admin API."

Run a first example: list accounts and properties

The Python quick start in the skill installs the client library and lists account summaries with list_account_summaries(). It prints each account and its child properties. The client picks up your Application Default Credentials automatically. Install the library with pip first. If pip is missing, the agent will ask you to install it.

pip install google-analytics-admin

Safety: scripts, network and configuration changes

This skill runs scripts and uses the network. The commands it gives make calls to Google Cloud and Google Analytics using your credentials. Review each command before the agent runs it, especially anything that changes settings.

Configuration changes affect tracking data and retention. Test changes on a non-production property, and review them before applying to live settings. The skill is not meant for changing live production settings without review.

  • Check which project and account the gcloud commands target.
  • Keep write operations on test properties until you have reviewed them.
  • Only use accounts where you have Analytics admin rights.

Tips for better results

Be specific about the outcome you want, such as the property ID, the stream type, or the setting to change. Name the language so the right client library guide is read. If you need v1alpha-only features, say so, since the skill notes that some capabilities such as audiences, BigQuery links and rollup properties exist only there, while v1beta is the most stable version.

  • Ask for a plan first, then approve each step.
  • State whether the task is read-only or a configuration change.
  • For reports, use the Analytics Data API or the Analytics interface instead.

What people use it for

  • List all accounts and child properties your Google account can access.
  • Provision a new Analytics property and its data stream as part of team onboarding.
  • Review or update custom dimensions and conversion (key) events across many properties.
  • Adjust property data retention settings in a test property before rolling out.
  • Link a property to Firebase or Google Ads through scripted configuration.

Frequently asked questions

How do I install the google analytics admin api basics skill?

Download the skill ZIP from this page and unzip it into ~/.claude/skills/ for personal use or into a project's .claude/skills/ folder. You can also upload it in the Claude apps under Settings → Capabilities → Skills.

What do I need to use this skill?

You need the Google Cloud CLI (gcloud), a Google Cloud project with the Analytics Admin API enabled, Application Default Credentials with the analytics.readonly or analytics.edit scope, and Google Analytics admin permissions. For the Python example you also need pip.

Is this skill free?

The skill is published under the Apache-2.0 licence. The source does not state pricing for Google Cloud or Google Analytics, so check those services' own terms.

Can this skill just show me my Analytics reports?

No. The skill is about configuring Google Analytics. For viewing reports, the source points to the Analytics Data API or the Analytics interface.

What is the difference between analytics.readonly and analytics.edit?

The login command uses analytics.readonly for read access. Methods that change account or property configuration need the analytics.edit scope, which the skill notes separately.

Why does the agent say gcloud is not found?

The skill asks the agent to prompt you to install the Google Cloud CLI when gcloud is missing. Install it, then ask again so the enable and login commands can run.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use this skill if you are a developer or analytics engineer who automates Google Analytics setup and wants an agent to handle the Admin API steps, including per-language client library guidance. Pick something else if you only need reports, since the Analytics Data API or the Analytics interface is a better fit, or if you cannot get Analytics admin rights and a Google Cloud project.

Download the skill