google-analytics-data-api-basics
Skill21k starsChanged 2 months agoApache-2.0View on GitHub
Manages Google Analytics reporting data, enables the Analytics Data API via the Cloud CLI, and creates reports using the Google Analytics Data API (v1beta). Use when you need to interact with Google Analytics properties, run customized analytics reports, query metrics (like activeUsers, screenPageViews) and dimensions (like city, date), check metrics and dimensions compatibility, or verify API enablement. Don't use for Google Analytics Admin API operations (e.g., creating properties, managing users) or for front-end tracking installation.
- Installs packages
1 other project uses a version of this, 1 of them edited.
Trending
Less talk lately.about the whole repository
Most recently taken up by
- isaccanedo/skillsedited, first seen Aug 4, 2026
Who's talking about google/skills
- @camilleroux.com“google/skills : dépôt open source de Google avec des dizaines de skills prêts à l'emploi pour agents IA sur …”Bluesky · Aug 11, 2026 · 9 likes
- A Hacker News story“Google repository now has 90 skills”Hacker News · Aug 6, 2026 · 5 points
- vercel-labs/skills“[Feature]: Support npx skills add to discover double nested skill directories”GitHub · Jun 23, 2026 · 5 reactions
- @matsuu.bsky.social“Google公式Skillsリポジトリ”Bluesky · May 2, 2026 · 5 likes
- @kweinmeister.bsky.social“Resources: - Vercel Labs Skills CLI: github.com/vercel-labs/... - Google Agent Skills: …”Bluesky · Jun 27, 2026 · 4 likes
The biggest 5 of 32 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 32
Talked about on Bluesky, GitHub, the web and Hacker News (32 times).
On Bluesky · 14
- Aug 11, 2026google/skills : dépôt open source de Google avec des dizaines de skills prêts à l'emploi pour agents IA sur GKE, BigQuery, Gemini API et… — @camilleroux.com9 likes and reposts · 4 replies
- May 2, 2026Google公式Skillsリポジトリ — @matsuu.bsky.social5 likes and reposts
- Jun 27, 2026Resources: - Vercel Labs Skills CLI: github.com/vercel-labs/... - Google Agent Skills: github.com/google/skills #AIAgents #GeminiAPI… — @kweinmeister.bsky.social4 likes and reposts
- Apr 22, 2026Google Cloud Next 2026 kicks off today with 3 developer announcements: * Google Agent Skills: github.com/google/skills * 75+ new codelabs:… — @kweinmeister.bsky.social4 likes and reposts
- Aug 7, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 google / skills ⭐ 15,983 (+305) 🗒 Python Agent Skills for Google products and technologies — @github-trending.bsky.social2 likes and reposts · 1 reply
9 more on Bluesky
- May 13, 2026Google の公式 skills! github.com/google/skills — @k-i.bsky.social2 likes and reposts
- Apr 22, 2026We announced Google's Official Agent Skills Repository at #GoogleCloudNext today 🥳 🚀 One command: 💻 npx skills install… — @boredabdel.bsky.social2 likes and reposts
- Oct 8, 2026Using npx to install agent skills from Google products, google/skills sets up workflows for cloud infrastructure and AI agents. 140 new… — @latreon.bsky.social1 likes and repost
- Oct 3, 2026📦 google / skills ⭐ 20,604 (+30) 🗒 Python Agent Skills for Google products and technologies — @github-trending.bsky.social1 likes and repost
- Jun 7, 2026github.com/google/skills — @bala.bsky.social1 likes and repost
- Jun 2, 2026google / skills Agent Skills for Google products and technologies https://github.com/google/skills — @pythonhub.dev1 likes and repost
- Apr 23, 2026Googleが提供するLLMのプロンプトを体系的に管理・評価するためのライブラリらしい 複雑なプロンプトの調整を効率化できそうで気になる yug1224 starred google/skills https://github.com/google/skills — @yug1224.com1 likes and repost
- Apr 23, 2026GitHub - google/skills: Agent Skills for Google products and technologies https://github.com/google/skills — @tech-trending.bsky.social1 likes and repost
- Jun 8, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 google / skills ⭐ 12,094 (+481) 🗒 Python Agent Skills for Google products and technologies — @github-trending.bsky.social0 likes and reposts · 1 reply
On GitHub · 12
- Jun 23, 2026[Feature]: Support npx skills add to discover double nested skill directories — vercel-labs/skills5 reactions · 4 comments
- Jun 24, 2026[Bug]: skills.sh page generates invalid command — vercel-labs/skills2 reactions · 3 comments
- Sep 30, 2026fix(sync-upstream-skills): upstream drift fails the sync instead of dropping the correction — gke-labs/kube-agents1 reaction · 9 comments
- Jun 30, 2026fix(discovery): discover triple-nested skills under container dirs — vercel-labs/skills1 reaction · 4 comments
- Oct 22, 2026sdk — seeleeleeyiavou-cell/Seeleeleeyiavou-cell0 reactions
7 more on GitHub
- Oct 12, 2026Upstream changes — RobStrayer/voice-agent-skills0 reactions
- Oct 3, 2026adk-multi-agent-supervisor-patterns — mjfuddel-eng/Emmyrecent.com0 reactions
- Sep 30, 2026[Candidate] google/skills - large collection (155 SKILL.md files) — ProSkillsMD/proskills0 reactions · 1 comment
- Sep 24, 2026https://github.com/google/skills https://drive.google.com/file/d/1aPgzQdVCHi4pADvdd89EiSVDFq8LFQCo/view?usp=drivesdk — at0116218-dot/Silvar0 reactions
- Sep 22, 2026No agy — davidstanke/notion-agent-demo0 reactions
- Sep 11, 2026Adhere to Agent Plugins specification — gemini-cli-extensions/google-secops0 reactions
- Apr 27, 2026remove .agent from skills path — kevmoo/dash_skills0 reactions
On the web · 4
- Jun 18, 2026Google Cloud Agent Skills - HeyClaude — heyclau.de
- Jun 9, 2026Google Launches Official Agent Skills Repository — pinggy.io
- May 25, 2026Agent Skills for Google: Free Open-Source Repo for AI & ... — facebook.com
- Apr 29, 2026Patrick Haggerty - google/skills — linkedin.com
On Hacker News · 2
- Aug 6, 2026Google repository now has 90 skills5 points
- Jun 9, 2026Google/skills: Agent Skills for Google products and technologies1 point · 1 comment
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- isaccanedo/skills★ 1100% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository159 other files it gives its agents.
- skills/cloud/developing-genkit-dart/references/agents.mdAGENTS.md
- skills/cloud/developing-genkit-go/references/agents.mdAGENTS.md
- skills/cloud/developing-genkit-js/references/agents.mdAGENTS.md
- skills/cloud/developing-genkit-python/references/agents.mdAGENTS.md
- skills/cloud/firebase-basics/references/refresh/claude.mdCLAUDE.md
- finding-google-skillsSkill
- gcloudSkill
- google-cloud-recipe-authSkill
- google-cloud-recipe-onboardingSkill
- retrieving-developer-knowledgeSkill
- data-manager-api-audience-ingestionSkill
- data-manager-api-event-ingestionSkill
- data-manager-api-setupSkill
- google-ads-api-account-diagnosticsSkill
- google-ads-api-mcp-setupSkill
- google-ads-api-quickstartSkill
- google-mobile-ads-android-migrate-to-next-genSkill
- google-mobile-ads-bannerSkill
- google-mobile-ads-get-startedSkill
- google-mobile-ads-interstitialSkill
- google-mobile-ads-rewardedSkill
- google-mobile-ads-validateSkill
- ima-dai-sdkSkill
- ima-sdk-client-sideSkill
- google-analytics-admin-api-basicsSkill
- agent-platform-alert-configurationSkill
- agent-platform-deploySkill
- agent-platform-endpoint-managementSkill
- agent-platform-eval-flywheelSkill
- agent-platform-inferenceSkill
- agent-platform-migrate-from-ai-studioSkill
- agent-platform-model-registrySkill
- agent-platform-prompt-managementSkill
- agent-platform-rag-engine-managementSkill
- agent-platform-skill-registrySkill
- agent-platform-troubleshootingSkill
- agent-platform-tuning-managementSkill
- agent-platform-tuningSkill
- alloydb-basicsSkill
- application-design-center-design-deploySkill
- bigquery-ai-mlSkill
- bigquery-basicsSkill
- bigquery-bigframesSkill
- bigquery-observabilitySkill
- bigquery-optimizationSkill
- bigquery-slot-cost-optimizerSkill
- bigquery-troubleshootingSkill
- bigtable-basicsSkill
- cloud-build-basicsSkill
- cloud-databases-onboardingSkill
- cloud-logging-configuration-basicsSkill
- cloud-logging-cross-project-configurationSkill
- cloud-logging-query-generationSkill
- cloud-monitoring-chart-generationSkill
- cloud-monitoring-list-time-series-requestSkill
- cloud-monitoring-metric-selectionSkill
- cloud-monitoring-promql-querySkill
- cloud-run-alert-configurationSkill
- cloud-run-basicsSkill
- cloud-sql-basicsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Before making API calls, ensure the Google Analytics Data API is enabled in your Google Cloud project.
- Very specific: line 22
If gcloud is not found, prompt the user to install the Google Cloud CLI before running these commands.
- Very specific: line 25
Enable the API: Use the Cloud CLI (gcloud) to enable analyticsdata.googleapis.com.
- Very specific: line 58
Always prefer the v1beta version of the API for stability and access to current Google Analytics reporting capabilities.
- Distinctive: line 69
If you need to install or set up the Google Analytics Data API client library for Python, read the setup guide:
- Very specific: line 136
If pip is not available, prompt the user to install pip before installing the client library.
- Very specific: line 189
When constructing your RunReportRequest, you must use valid API names for dimensions and metrics.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Getting Started with Google Analytics Data API
The Google Analytics Data API v1beta provides programmatic access to Google Analytics report data. It allows you to build customized dashboards, automate reporting workflows, and integrate Google Analytics data into your enterprise applications.
Enabling the API via Cloud CLI
Before making API calls, ensure the Google Analytics Data API is enabled in your Google Cloud project.
If gcloud is not found, prompt the user to install the Google Cloud CLI before
running these commands.
Enable the API: Use the Cloud CLI (
gcloud) to enableanalyticsdata.googleapis.com.gcloud services enable analyticsdata.googleapis.com --quietWhy: Enabling the API ensures your Cloud project has the necessary quota and permissions allocated for running Google Analytics reports.
Verify API Enablement:
gcloud services list --enabled --filter="analyticsdata.googleapis.com"
Authentication
To authenticate your API requests, you must generate Application Default Credentials (ADC) and give your account the necessary scopes. Run the following command in your terminal:
gcloud auth application-default login --scopes="https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/analytics.readonly"Why: This configures ADC in your local environment with the required Cloud Platform and Google Analytics read-only scopes, allowing the client library to automatically authenticate your requests.
Creating a Data API Report (v1beta)
To create a report, use the official Google Analytics Data client library.
Always prefer the v1beta version of the API for stability and access to
current Google Analytics reporting capabilities.
[!IMPORTANT] Mandatory Agent Directive: When the user selects or requires a specific programming language, read the corresponding client library setup reference guide in
references/listed below.
Supported Client Libraries
Python
If you need to install or set up the Google Analytics Data API client library for Python, read the setup guide:
- Python Installation Reference (Package:
google-analytics-data)
Java
If you need to install or set up the Google Analytics Data API client library for Java, read the setup guide:
- Java Installation Reference (Artifact:
com.google.cloud:google-cloud-analytics-data)
PHP
If you need to install or set up the Google Analytics Data API client library for PHP, read the setup guide:
- PHP Installation Reference (Package:
google/analytics-data)
Node.js
If you need to install or set up the Google Analytics Data API client library for Node.js, read the setup guide:
- Node.js Installation Reference (Package:
@google-analytics/data)
Go
If you need to install or set up the Google Analytics Data API client library for Go, read the setup guide:
- Go Installation Reference (Package:
cloud.google.com/go/analytics/data/apiv1beta)
.NET
If you need to install or set up the Google Analytics Data API client library for .NET / C#, read the setup guide:
- .NET Installation Reference (Package:
Google.Analytics.Data.V1Beta)
Ruby
If you need to install or set up the Google Analytics Data API client library for Ruby, read the setup guide:
- Ruby Installation Reference (Gem:
google-analytics-data-v1beta)
[!NOTE] Additional Resources: For further examples of calling the Data API with Java, PHP, Node.js, .NET, Python and REST, as well as hints on authentication with a service account, refer to the official Data API Quickstart.
Python Quick Start
Install the Client Library:
pip install google-analytics-dataIf
pipis not available, prompt the user to installpipbefore installing the client library.Run a Report Request: Below is a complete example demonstrating how to query a Google Analytics property for active users and sessions grouped by city and date. Replace
YOUR-PROPERTY-IDwith your actual Google Analytics property ID (e.g.,1234567).from google.analytics.data_v1beta import BetaAnalyticsDataClient from google.analytics.data_v1beta.types import DateRange, Dimension, Metric, RunReportRequest def sample_run_report(property_id: str): # Initialize the client. # Assumes Application Default Credentials (ADC) are configured in your environment. client = BetaAnalyticsDataClient() request = RunReportRequest( property=f"properties/{property_id}", dimensions=[ Dimension(name="city"), Dimension(name="date") ], metrics=[ Metric(name="activeUsers"), Metric(name="sessions") ], date_ranges=[ DateRange(start_date="2026-05-01", end_date="today") ], ) response = client.run_report(request) print(f"Report result for property {property_id}:") for row in response.rows: print( f"City: {row.dimension_values[0].value}, " f"Date: {row.dimension_values[1].value}, " f"Active Users: {row.metric_values[0].value}, " f"Sessions: {row.metric_values[1].value}" ) if __name__ == "__main__": sample_run_report("YOUR-PROPERTY-ID")Why: Using
BetaAnalyticsDataClientandRunReportRequestensures compatibility with the v1beta endpoint and strongly typed request validation.
Metrics and Dimensions Schema
When constructing your RunReportRequest, you must use valid API names for
dimensions and metrics. Refer to the official
Data API Schema documentation
for the complete, authoritative list of available fields.
Commonly Used Dimensions
Dimensions represent categorical attributes of your data.
city: The town or city of the user.country: The country of the user.date: The date of the event, formatted as YYYYMMDD.deviceCategory: The category of mobile device (e.g., desktop, mobile, tablet).eventName: The name of the triggered event.pageTitle: The title of the web page.
Commonly Used Metrics
Metrics represent quantitative measurements.
activeUsers: The number of active users.eventCount: The total count of events.sessions: The total number of sessions.screenPageViews: The number of app screens or web pages viewed.totalRevenue: The total revenue from purchases, subscriptions, and advertising.
Metrics and Dimensions Compatibility Check
Some dimensions and metrics cannot be queried together in the same report
request. If you encounter an INVALID_ARGUMENT error regarding incompatible
fields, verify your field combinations For programmatic access to the Data API
schema, use getMetadata(). To programmatically check the compatibility of
specific dimension and metric combinations before running a report, use the
checkCompatibility() method.
from google.analytics.data_v1beta import BetaAnalyticsDataClient
from google.analytics.data_v1beta.types import CheckCompatibilityRequest, Compatibility, Dimension, Metric
def sample_check_compatibility(property_id: str):
client = BetaAnalyticsDataClient()
# Define the dimensions and metrics you want to query together.
# For example, checking if 'itemName' (an e-commerce dimension)
# is compatible with 'activeUsers' and 'totalRevenue'.
request = CheckCompatibilityRequest(
property=f"properties/{property_id}",
dimensions=[
Dimension(name="itemName"),
Dimension(name="date")
],
metrics=[
Metric(name="activeUsers"),
Metric(name="totalRevenue")
],
)
response = client.check_compatibility(request)
print(f"Compatibility check for property {property_id}:")
for dim in response.dimension_compatibilities:
is_compatible = dim.compatibility == Compatibility.COMPATIBLE
print(f"Dimension '{dim.dimension_metadata.api_name}' is compatible: {is_compatible}")
for metric in response.metric_compatibilities:
is_compatible = metric.compatibility == Compatibility.COMPATIBLE
print(f"Metric '{metric.metric_metadata.api_name}' is compatible: {is_compatible}")
if __name__ == "__main__":
sample_check_compatibility("YOUR-PROPERTY-ID")Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

