ต้นแบบ · รุ่นทดลอง: มีทุก server ในทะเบียนทางการ อัปเดตทุก 30 นาที รีวิวและบัญชีผู้ใช้จะมาในขั้นถัดไป
PopNx MCPที่รวม MCP สำหรับคนใช้ AI · อธิบายเป็นภาษาคน

MCP Google Analytics

โดย leonardosepulvedatรุ่น 1.3.0i★ –iรันบนเครื่อง
ชื่อใน registryio.github.leonardosepulvedat/mcp-google-analytics

ติดตั้ง

ภาพรวม

คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)

GA4 MCP that reads AND writes: reports, funnels, audits, and server-side events. 26 tools.

สามเสาของ PopNx MCP

สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน

ใช้ทำอะไรได้

ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry

  • การเชื่อมต่อ: รันบนเครื่อง
  • ช่องทาง (transport): stdio
  • หมวด: การตลาดและโซเชียล
  • ต้องใส่ค่าเหล่านี้: GA_SERVICE_ACCOUNT_JSON, GA_API_SECRET

ติดตั้ง

เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง

ก่อนติดตั้ง

ค่าที่ติดป้ายความลับคือกุญแจของบัญชีคุณ อย่าส่งให้ใคร และอย่าวางในแชต

ต้องเตรียมก่อน

  • npmติดตั้ง Node.js (มีคำสั่ง npx) ในเครื่อง

คุณใช้แอปไหน

เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”

เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json

{
  "mcpServers": {
    "google-analytics": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-google-analytics"
      ],
      "env": {
        "GA_SERVICE_ACCOUNT_JSON": "ใส่ค่าของคุณ",
        "GA_PROPERTY_ID": "ใส่ค่าของคุณ",
        "GA_MEASUREMENT_ID": "ใส่ค่าของคุณ",
        "GA_API_SECRET": "ใส่ค่าของคุณ"
      }
    }
  }
}

พิมพ์คำสั่งนี้ใน Terminal

claude mcp add google-analytics --env GA_SERVICE_ACCOUNT_JSON='ใส่ค่าของคุณ' --env GA_PROPERTY_ID='ใส่ค่าของคุณ' --env GA_MEASUREMENT_ID='ใส่ค่าของคุณ' --env GA_API_SECRET='ใส่ค่าของคุณ' -- npx -y mcp-google-analytics

เติมค่าที่เว้นว่างไว้ก่อนรัน

เปิดใน Cursor

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json

{
  "mcpServers": {
    "google-analytics": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-google-analytics"
      ],
      "env": {
        "GA_SERVICE_ACCOUNT_JSON": "ใส่ค่าของคุณ",
        "GA_PROPERTY_ID": "ใส่ค่าของคุณ",
        "GA_MEASUREMENT_ID": "ใส่ค่าของคุณ",
        "GA_API_SECRET": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

เปิดใน VS Code

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .vscode/mcp.json ของโปรเจกต์

{
  "servers": {
    "google-analytics": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "mcp-google-analytics"
      ],
      "env": {
        "GA_SERVICE_ACCOUNT_JSON": "ใส่ค่าของคุณ",
        "GA_PROPERTY_ID": "ใส่ค่าของคุณ",
        "GA_MEASUREMENT_ID": "ใส่ค่าของคุณ",
        "GA_API_SECRET": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น

ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี

ค่าที่ต้องใส่เอง

  • GA_SERVICE_ACCOUNT_JSON ความลับ env
    Service account JSON for reading reports: file path or inline JSON (needed for read tools)
  • GA_PROPERTY_ID env
    Numeric GA4 property ID, e.g. 123456789 (needed for read tools)
  • GA_MEASUREMENT_ID env
    Measurement ID of the data stream, e.g. G-XXXXXXXXXX (needed for event-sending tools)
  • GA_API_SECRET ความลับ env
    Measurement Protocol API secret (needed for event-sending tools)

ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README

ทำอะไรได้บ้าง

รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง

ผลตรวจเบื้องต้นi

เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 7 พ.ย. 2569

  • ✓ ผ่าน

    ตัวตนผู้ทำตรงกับ repo

    ชื่อใน registry ยืนยันด้วยบัญชี GitHub leonardosepulvedat ซึ่งเป็นเจ้าของ repo

  • … ยังไม่ตรวจ

    ยังมีคนดูแล

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • … ยังไม่ตรวจ

    มีสัญญาอนุญาต (license)

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • – ไม่เกี่ยว

    endpoint ตอบ

    ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

    ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน

  • … ยังไม่ตรวจ

    คำอธิบายเครื่องมือไม่มีคำสั่งแอบแฝง

    รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต

เทียบกับตัวอื่นในหมวด การตลาดและโซเชียลi

  • ดาวมากกว่า 0% ของอีก 3558 ตัวในหมวดนี้
  • ส่งรุ่นใหม่เข้า registry ล่าสุดกว่า 27% ของอีก 3558 ตัวในหมวดนี้
  • ผลตรวจเบื้องต้นดีกว่าหรือเท่ากับ 100% ของอีก 3558 ตัวในหมวดนี้

เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo

คำถามที่พบบ่อย

MCP Google Analytics ปลอดภัยไหม?

จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น

ต้องใช้กุญแจหรือรหัสอะไรบ้าง?

ต้องใส่ค่าเหล่านี้: GA_SERVICE_ACCOUNT_JSON, GA_API_SECRET

ตัวนี้รันบนเครื่องหรือบนคลาวด์?

รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)

ยังมีคนดูแลอยู่ไหม?

repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (1.3.0) เข้า registry 3 เดือนที่ผ่านมา

ใช้กับโปรแกรมไหนได้บ้าง?

โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Node.js ในเครื่องด้วย

มีตัวไหนใช้แทนได้บ้าง?

ในหมวดเดียวกันมี MCP YouTube Transcript, Google Analytics MCP, BibiGPT YouTube Video Summarizer

ตัวที่ใช้แทนได้

server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว

อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi

MCP YouTube Transcript

โดย jkawamoto

An MCP server retrieving transcripts of YouTube videos

รันบนเครื่อง★ 495MITอัปเดต 10 วันที่ผ่านมา
ติดตั้ง

Google Analytics MCP

โดย surendranb

GA4 MCP server for AI agents: schema discovery, server-side aggregation, analysis-ready defaults.

รันบนเครื่อง★ 244MITอัปเดต 10 วันที่ผ่านมา
ติดตั้ง

AI video summarizer: summarize and transcribe YouTube, Bilibili, TikTok and podcast videos.

รันบนคลาวด์★ 137MITอัปเดต 10 วันที่ผ่านมา
ติดตั้ง

README จากผู้ทำ

เปิดอ่าน README

ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ

MCP Google Analytics Server

A Model Context Protocol (MCP) server for Google Analytics 4, providing comprehensive integration with both the Google Analytics Data API (for reading reports) and Measurement Protocol v2 (for sending events).

The GA4 MCP that reads AND writes. Most GA4 MCP servers (including Google's official one) are read-only. This one gives your AI agent the full loop: run reports and funnels, audit your setup (custom dimensions, key events, compatibility checks), send ecommerce and conversion events server-side, and verify them in the realtime report — 26 tools in one npx command.

Built for agencies too: every read tool accepts an optional propertyId, so one conversation can query all your clients' properties — no reconfiguration between clients. See Multi-Property Mode.

⚡ One-Click Install

You only need two values to start (same as any other GA4 MCP): the service account JSON and your property ID. Sending events is an optional extra.

Click Install in Cursor, then paste:

  1. `GA_SERVICE_ACCOUNT_JSON` — path to the downloaded key file, or the JSON itself
  2. `GA_PROPERTY_ID` — the numeric ID in GA4 Admin → Property Settings (e.g. 123456789)

That is enough to ask “users by country this week”. To also send events, add two more keys later (see Send events (optional)).

💡 Keep reports small

Reports can get large. This server is designed with token optimization in mind:

  • All read tools default to 10 results - Adjust the limit parameter as needed
  • Use specific date ranges - Avoid querying years of data at once
  • Select only needed dimensions/metrics - Don't request everything
  • Check [TOKEN_OPTIMIZATION.md](TOKEN_OPTIMIZATION.md) for detailed best practices

See the dedicated Token Optimization Guide for strategies to minimize token usage.

🚀 Quick Start

See QUICKSTART.md for a 5-minute setup guide, or follow the installation steps below.

📦 Installation

Option 1: Install globally via npm
npm install -g mcp-google-analytics
Option 2: Use with npx (no installation needed)
npx mcp-google-analytics

🔧 Configuration

Start with two values. That unlocks reports, funnels, realtime, and property audits — everything most people need, and the same setup every other GA4 MCP asks for.

1. Service account key
  1. In Google Cloud Console, enable Google Analytics Data API.
  2. IAM & Admin → Service Accounts → Create. Download a JSON key.
  3. In GA4: Admin → Property Access Management → add the service account email as Viewer.

Use the file path or paste the JSON into GA_SERVICE_ACCOUNT_JSON.

2. Property ID

GA4 Admin → Property Settings → Property ID (numbers only, e.g. 123456789).

{

"mcpServers": { "google-analytics": { "command": "npx", "args": ["-y", "mcp-google-analytics"], "env": { "GA_SERVICE_ACCOUNT_JSON": "/path/to/service-account.json", "GA_PROPERTY_ID": "123456789" } } } }

You can now ask: *“Show me active users by country this week.”*

Send events (optional)

Only if you want the agent to record events (purchases, signups, custom events). Most GA4 MCPs cannot do this; it is extra, not required.

  1. GA4 Admin → Data Streams → your stream → copy Measurement ID (G-XXXXXXXXXX).
  2. Measurement Protocol API secrets → Create → copy the secret.

Add them next to the two values you already have:

"GA_MEASUREMENT_ID": "G-XXXXXXXXXX",

"GA_API_SECRET": "your-api-secret"

🏢 Multi-Property Mode (Agencies)

Every read tool accepts an optional propertyId argument that overrides the configured GA_PROPERTY_ID — so a single conversation can query any property the service account can access, with no reconfiguration between clients.

  1. Grant your service account "Viewer" access on each client's GA4 property (or at account level).
  2. Set only GA_SERVICE_ACCOUNT_JSON (GA_PROPERTY_ID becomes optional — if set, it acts as the default).
  3. Discover properties, then query any of them:
Show me all my accounts and properties          → ga_get_account_summaries

Compare last week's active users between the → ga_run_report with propertyId "111111" Acme property and the Globex property and again with propertyId "222222"

propertyId accepts both 123456789 and properties/123456789. Event sending (Measurement Protocol) remains tied to the configured GA_MEASUREMENT_ID/GA_API_SECRET, since each data stream has its own secret.

🔌 Integration with Claude Desktop

Add to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%/Claude/claude_desktop_config.json

{

"mcpServers": { "google-analytics": { "command": "npx", "args": ["-y", "mcp-google-analytics"], "env": { "GA_SERVICE_ACCOUNT_JSON": "/path/to/service-account.json", "GA_PROPERTY_ID": "123456789" } } } }

Or if installed globally:

{

"mcpServers": { "google-analytics": { "command": "mcp-google-analytics", "env": { "GA_SERVICE_ACCOUNT_JSON": "/path/to/service-account.json", "GA_PROPERTY_ID": "123456789" } } } }

Restart Claude Desktop after updating the configuration.

🎯 Integration with Cursor

Add to your Cursor MCP settings file:

macOS/Linux: ~/.cursor/mcp.json Windows: %USERPROFILE%\.cursor\mcp.json

{

"mcpServers": { "google-analytics": { "command": "npx", "args": ["-y", "mcp-google-analytics"], "env": { "GA_SERVICE_ACCOUNT_JSON": "/path/to/service-account.json", "GA_PROPERTY_ID": "123456789" } } } }

Restart Cursor after updating the configuration.

🛠️ Available Tools

At a Glance

Reading data (Google Analytics Data API) — all read tools default to 10 rows to save tokens:

ToolPurposeNotes
ga_run_reportCustom reports with dimensions and metricsAdjust limit as needed
ga_run_realtime_reportReal-time data (last 30 minutes)Great for verifying sent events
ga_get_metadataAll available dimensions and metricsLarge response (500+ items), use sparingly
ga_list_accountsList accessible GA accounts
ga_list_propertiesList GA4 propertiesAggregates all accounts if no accountId
ga_get_propertyDetails of the configured property
ga_list_data_streamsData streams of the propertyUseful to find measurement IDs
ga_run_pivot_reportPivot table reportsResponses can be very large
ga_run_funnel_reportFunnel analysis across event stepsUses Data API v1alpha
ga_batch_run_reportsMultiple reports in one request2–5 reports per batch recommended
ga_get_account_summariesAll accounts and properties in one callFastest way to discover IDs
ga_list_custom_dimensionsCustom dimensions of the propertyDiscover API names for reports
ga_list_custom_metricsCustom metrics of the propertyDiscover API names for reports
ga_list_key_eventsKey events (conversions) of the propertyKnow what counts as a conversion
ga_list_google_ads_linksGoogle Ads accounts linked to the property
ga_check_compatibilityValidate dimension/metric combos before reportingAvoids wasted requests and error loops

Sending events (Measurement Protocol):

ToolPurpose
ga_send_eventAny custom GA4 event with parameters
ga_validate_eventTest an event against the debug endpoint without recording it
ga_send_pageviewPage/screen views
ga_send_purchaseEcommerce purchases with transaction and items
ga_send_loginUser logins
ga_send_signupUser registrations
ga_send_view_itemProduct/item detail views
ga_send_add_to_cartAdd-to-cart events
ga_send_begin_checkoutCheckout initiations
ga_send_refundFull or partial refunds
Google Analytics Data API (Reading Data)
ga_run_report

Run custom reports with dimensions and metrics.

Common Dimensions: date, city, country, deviceCategory, browser, pagePath, eventName, sessionSource, sessionMedium, sessionCampaignName

Common Metrics: activeUsers, sessions, screenPageViews, conversions, totalRevenue, engagementRate, averageSessionDuration

Example:

{

"dateRanges": [{"startDate": "7daysAgo", "endDate": "today"}], "dimensions": [{"name": "city"}], "metrics": [{"name": "activeUsers"}], "limit": 10 }

ga_run_realtime_report

Get real-time data (last 30 minutes).

Example:

{

"metrics": [{"name": "activeUsers"}], "dimensions": [{"name": "country"}], "limit": 10 }

ga_get_metadata

Get all available dimensions and metrics for your property.

Warning: Returns 500+ items. Use sparingly.

ga_list_accounts

List all GA accounts accessible to the service account.

ga_list_properties

List GA4 properties, optionally filtered by account ID.

ga_get_property

Get details about the configured property.

ga_list_data_streams

List data streams for the configured property.

ga_run_pivot_report

Run pivot table reports with row/column dimensions.

Example:

{

"dateRanges": [{"startDate": "7daysAgo", "endDate": "today"}], "dimensions": [{"name": "country"}, {"name": "deviceCategory"}], "metrics": [{"name": "activeUsers"}], "pivots": [{"fieldNames": ["deviceCategory"], "limit": 5}] }

ga_run_funnel_report

Run funnel analysis to track user progression.

Note: Funnel reporting uses the Data API v1alpha channel (the only channel where Google exposes it). Each step matches an event: set eventName per step, or omit it to use the step's name as the event name. For advanced matching, pass a full filterExpression.

Example:

{

"dateRanges": [{"startDate": "7daysAgo", "endDate": "today"}], "funnelSteps": [ {"name": "page_view"}, {"name": "add_to_cart"}, {"name": "begin_checkout"}, {"name": "Purchase", "eventName": "purchase"} ] }

ga_batch_run_reports

Run multiple reports in a single request.

Warning: Can return large datasets. Limit to 2-5 reports per batch.

ga_get_account_summaries

Get all accessible accounts with their properties in a single compact call. The fastest way to discover account and property IDs.

ga_list_custom_dimensions / ga_list_custom_metrics

List the custom dimensions and metrics defined for the property, including their API names (e.g., customEvent:plan_type) so yo

ตัดมาแค่ช่วงต้น อ่านต่อใน repo

ถาม PopNx