본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트22k · #10197

google-analytics-data-api-basics

하는 일

Google Analytics 속성에 대해 활성 사용자 같은 지표와 도시나 날짜 같은 차원을 결합해 맞춤 보고서를 실행합니다. Analytics 데이터로 대시보드를 만드는 분석가와 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓특정 지표와 차원으로 맞춤 Google Analytics 보고서가 필요할 때.
  • ✓지표와 차원을 함께 사용할 수 있는지 확인해야 할 때.
  • ✓보고서를 실행하기 전에 Analytics Data API가 활성화되었는지 확인하고 싶을 때.

스킬 링크

https://github.com/google/skills/blob/main/skills/analytics/google-analytics-data-api-basics/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/google/skills/blob/main/skills/analytics/google-analytics-data-api-basics/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“지난달 제 Analytics 속성에서 도시별 활성 사용자와 화면 페이지 조회수를 보여 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 Google Cloud CLI로 Data API를 활성화하고, 자격 증명을 설정한 뒤, 선택한 지표와 차원으로 만든 v1beta 보고서 요청을 실행합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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.

  1. Enable the API: Use the Cloud CLI (gcloud) to enable analyticsdata.googleapis.com.

    gcloud services enable analyticsdata.googleapis.com --quiet
    

    Why: Enabling the API ensures your Cloud project has the necessary quota and permissions allocated for running Google Analytics reports.

  2. 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:

Java

If you need to install or set up the Google Analytics Data API client library for Java, read the setup guide:

PHP

If you need to install or set up the Google Analytics Data API client library for PHP, read the setup guide:

Node.js

If you need to install or set up the Google Analytics Data API client library for Node.js, read the setup guide:

Go

If you need to install or set up the Google Analytics Data API client library for Go, read the setup guide:

.NET

If you need to install or set up the Google Analytics Data API client library for .NET / C#, read the setup guide:

Ruby

If you need to install or set up the Google Analytics Data API client library for Ruby, read the setup guide:

[!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

  1. Install the Client Library:

    pip install google-analytics-data
    

    If pip is not available, prompt the user to install pip before installing the client library.

  2. 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-ID with your actual Google Analytics property ID (e.g., 1234567).

    from google.analytics.
    
자주 묻는 질문

특별한 설정이 필요한가요?

네. 먼저 API를 활성화하고 Application Default Credentials를 설정합니다.

어떤 필드들이 함께 작동하는지 확인할 수 있나요?

네. 지표와 차원이 호환되는지 확인할 수 있습니다.

어떤 API 버전을 쓰나요?

Analytics Data API v1beta입니다.

상세 정보

작성자의 원본 설명

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.

repo: google/skills

인기도

GitHub 스타
22k
순위
#10197
라이선스
Apache-2.0
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬