To build Google Analytics reporting and property management integrations with higher
accuracy and lower token overhead, equip your AI coding agent with Google Analytics AI
agent skills. Designed for developers who build with the
Google Analytics Data API and Google Analytics Admin API, Google Analytics AI agent skills are
portable, self-contained modules of instructions, workflows, and client library
references.

These AI agent skills work with AI coding agents that support the [open
Agent Skills standard](https://agentskills.io/home),
including Google Antigravity, Claude Code, Codex, and Cursor. For a list of
published skills, see [Available skills](https://developers.google.com/analytics/devguides/agent-skills.md.txt#available-skills).

## Before you begin

Before installing and running Google Analytics AI agent skills, complete the following
prerequisites:

- Install an AI coding agent that supports the [open
  Agent Skills standard](https://agentskills.io/home), such as Google Antigravity, Claude Code, Codex, or Cursor.
- Install [Node.js](https://nodejs.org/), which includes the `npx` command for installing and updating skills from the command line.
- Create or select a [project](https://cloud.google.com/resource-manager/docs/creating-managing-projects) with access to a Google Analytics property when running API workflows.

## Get started

Install, update, and invoke Google Analytics AI agent skills in your development
environment.

### Install Google Analytics AI agent skills

Install the Google Analytics skill suite in your project directory by using the `npx`
command, or configure your editor directly:

### Antigravity

Run the following command in your project directory:

```bash
npx skills add google/skills/skills/analytics --agent=antigravity
```

### Claude Code

Run the following command in your project directory:

```bash
npx skills add google/skills/skills/analytics --agent=claude-code
```

### Codex

Run the following command in your project directory:

```bash
npx skills add google/skills/skills/analytics --agent=codex
```

### Cursor

Add the skill repository URL (`https://github.com/google/skills`) in your
editor settings under custom rules. For instructions, see the
[Cursor documentation on installing skills from GitHub](https://cursor.com/docs/skills#installing-skills-from-github).

Alternatively, install the skills in your project directory by using the
`npx` command:

```bash
npx skills add google/skills/skills/analytics --agent=cursor
```

### Other agents

For other AI coding agents that support the open
Agent Skills standard, run the following command
in your project directory:

```bash
npx skills add google/skills/skills/analytics
```

> [!NOTE]
> **Note:** AI agent skills are actively developed. To keep your AI coding agent updated with the latest Google Analytics features, best practices, and security recommendations, regularly [update your skills](https://developers.google.com/analytics/devguides/agent-skills.md.txt#update-skills).

### Update Google Analytics AI agent skills

Download available updates and clean up outdated skills by running the
following command:

```bash
npx skills update --all
```

### Use Google Analytics AI agent skills

AI coding agents load skills automatically when they detect that a skill's
description matches your prompt. Globally installed skills remain dormant in
unrelated projects unless your request involves Google Analytics tasks.

To invoke a skill manually in supported AI coding agents, enter the `/`
character in the chat input and select the skill by name.

## Core components of a skill

Each Google Analytics AI agent skill provides your AI coding agent with the following
components:

- **Specialized instructions** : Step-by-step guidance for enabling the Google Analytics APIs with the gcloud CLI, configuring [Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/provide-credentials-adc), building `runReport` queries, and checking field compatibility.
- **Best practices** : Recommended API version selection (`v1beta` endpoints for general stability and `v1alpha` endpoints for early-access Admin API features), strongly typed request construction, and schema validation workflows.
- **Reference documentation** : Language-specific client library installation guides and code samples for Python, Java, Node.js, PHP, Go, .NET, and Ruby in each skill's `references/` directory.

## Benefits of AI agent skills

AI agent skills extend your AI coding agent with specialized Google Analytics knowledge
on demand, without loading large documentation sets into every conversation.

### Reduced token costs

Loading full API reference documentation upfront consumes context tokens and
increases session costs. AI agent skills use **progressive disclosure** to
minimize context usage:

- At startup, the AI coding agent reads only each skill's name and short description to check whether the skill matches your prompt.
- The agent loads the full `SKILL.md` instructions and language-specific reference files into the active context window only when your task requires them.

### AI-guided implementation

Describe your goal in natural language, and installed skills guide your AI
coding agent through Google Analytics implementation tasks such as the following:

- *Enable the Google Analytics Data API in my project and write
  a Python script that queries the `activeUsers` and `sessions` metrics by the
  `city` and `date` dimensions.*
- *Check whether the `itemName` dimension is compatible with the `activeUsers`
  and `totalRevenue` metrics for my Google Analytics property by using the
  `checkCompatibility` method.*
- *List all accessible Google Analytics account summaries and child properties in
  Node.js by using the Google Analytics Admin API.*
- *Configure custom dimensions, data streams, and Measurement Protocol
  secrets for my Google Analytics property.*

## Use skills alongside the Google Analytics MCP server

Google Analytics AI agent skills complement the
[Google Analytics Model Context Protocol (MCP) server](https://developers.google.com/analytics/devguides/MCP.md.txt):

- **Google Analytics MCP server**: Connects your AI coding agent directly to live Google Analytics properties so the agent can inspect account summaries, property details, custom dimensions, custom metrics, and live reports.
- **Google Analytics AI agent skills**: Provide token-efficient instructions and client library references that guide your AI coding agent when enabling APIs, configuring ADC authentication, checking field compatibility, and writing application code.

> [!NOTE]
> **Note:** Install both the [Google Analytics MCP server](https://developers.google.com/analytics/devguides/MCP.md.txt) and Google Analytics AI agent skills to inspect live property schemas through MCP tools and generate validated client library code.

## Available skills

Google maintains the following [Google Analytics AI agent skills](https://github.com/google/skills/tree/main/skills/analytics) in
the [`google/skills`](https://github.com/google/skills) repository:

| Skill | Description |
|---|---|
| [`google-analytics-data-api-basics`](https://github.com/google/skills/tree/main/skills/analytics/google-analytics-data-api-basics) | Enables the Google Analytics Data API (`analyticsdata.googleapis.com`) with the gcloud CLI, configures ADC with the `analytics.readonly` OAuth 2.0 scope, and installs official `v1beta` client libraries (Python, Java, PHP, Node.js, Go, .NET, and Ruby). Guides your agent in building `runReport` queries and checking field compatibility with the `getMetadata` and `checkCompatibility` methods. |
| [`google-analytics-admin-api-basics`](https://github.com/google/skills/tree/main/skills/analytics/google-analytics-admin-api-basics) | Enables the Google Analytics Admin API (`analyticsadmin.googleapis.com`) with the gcloud CLI, configures ADC with the `analytics.readonly` and `analytics.edit` OAuth 2.0 scopes, and installs official `v1beta` and `v1alpha` client libraries (Python, Java, PHP, Node.js, Go, .NET, and Ruby). Guides your agent in listing account summaries and managing properties, data streams, custom dimensions, custom metrics, key events, Measurement Protocol secrets, and product links. |

## Next steps

- [Try the Google Analytics MCP server](https://developers.google.com/analytics/devguides/MCP.md.txt) to connect your AI coding agent to live Google Analytics properties and reports.
- Complete the [Google Analytics Data API quickstart](https://developers.google.com/analytics/devguides/reporting/data/v1/quickstart.md.txt) or the [Google Analytics Admin API quickstart](https://developers.google.com/analytics/devguides/config/admin/v1/quickstart.md.txt).
- Explore the [Google Analytics Data API dimensions and metrics
  schema](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema).
- [Use AI agent skills in Google Antigravity](https://antigravity.google/docs/skills).
- [Use AI agent skills in Claude Code](https://code.claude.com/docs/en/skills).