मुख्य सामग्री पर जाएँ
Skillpedia
एनालिसिस और स्प्रेडशीट22k · #10197

google-analytics-data-api-basics

यह क्या करती है

यह किसी Google Analytics प्रॉपर्टी पर कस्टम रिपोर्ट चलाती है, सक्रिय उपयोगकर्ता जैसे मेट्रिक्स को शहर या तारीख जैसे dimensions के साथ जोड़कर। यह उन एनालिस्ट और डेवलपर्स के लिए है जो Analytics डेटा से डैशबोर्ड बनाते हैं।

कब इस्तेमाल करें

  • ✓जब आपको विशेष मेट्रिक्स और dimensions के साथ कस्टम Google Analytics रिपोर्ट चाहिए।
  • ✓जब आपको जाँचना हो कि कोई मेट्रिक और dimension एक साथ इस्तेमाल हो सकते हैं या नहीं।
  • ✓जब आप रिपोर्ट चलाने से पहले पक्का करना चाहते हों कि Analytics Data API चालू है।

Skill का लिंक

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

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/google/skills/blob/main/skills/analytics/google-analytics-data-api-basics/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरी Analytics प्रॉपर्टी में पिछले महीने के लिए शहर के हिसाब से सक्रिय उपयोगकर्ता और स्क्रीन पेज व्यू दिखाइए।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

यह Google Cloud CLI से Data API चालू करती है, क्रेडेंशियल सेट करती है, और आपके चुने मेट्रिक्स व dimensions से बनी 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 सेट करती है।

क्या यह जाँच सकती है कि कौन से फ़ील्ड एक साथ काम करते हैं?

हाँ। यह जाँच सकती है कि मेट्रिक्स और dimensions एक-दूसरे के साथ मेल खाते हैं या नहीं।

यह कौन सा 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
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

finding-google-skills

22k

आपके एजेंट को किसी सेटअप काम के लिए सही Google गाइड खोजने में मदद करती है, जैसे hosting, databases, storage, sign-in या AI model serving।

AI और एजेंटएजेंट

gcloud

22k

यह आपके एजेंट को Google Cloud gcloud कमांड लिखने और जाँचने में मदद करती है, कुछ भी चलाने से पहले सटीक सिंटैक्स देखकर, ताकि फ़्लैग का अंदाज़ा न लगे।

कोडिंगडिप्लॉय और क्लाउड (DevOps)

google-cloud-recipe-auth

22k

आपके एजेंट को Google Cloud की पहचान और पहुँच समझाती है, जिसमें यह शामिल है कि लोग और सेवाएँ कैसे साइन इन करते हैं और उन्हें कौन सी अनुमतियाँ मिलती हैं।

कोडिंगसिक्योरिटी

google-cloud-recipe-onboarding

22k

एक नए डेवलपर को Google Cloud पर पहले कदमों में मदद करती है, जिसमें प्रोजेक्ट चुनना, बिलिंग जोड़ना और पहला संसाधन डिप्लॉय करना शामिल है।

कोडिंगडिप्लॉय और क्लाउड (DevOps)

मिलती-जुलती skills