{
  "schemaVersion": "1.0",
  "item": {
    "slug": "google-analytics",
    "name": "Google Analytics",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/byungkyu/google-analytics",
    "canonicalUrl": "https://clawhub.ai/byungkyu/google-analytics",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/google-analytics",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=google-analytics",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "LICENSE.txt"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/google-analytics"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/google-analytics",
    "agentPageUrl": "https://openagent3.xyz/skills/google-analytics/agent",
    "manifestUrl": "https://openagent3.xyz/skills/google-analytics/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/google-analytics/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Google Analytics",
        "body": "Access Google Analytics with managed OAuth authentication. This skill covers both the Admin API (manage accounts, properties, data streams) and the Data API (run reports on metrics)."
      },
      {
        "title": "Quick Start",
        "body": "# List account summaries (Admin API)\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/google-analytics-admin/v1beta/accountSummaries')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\n# Run a report (Data API)\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'dateRanges': [{'startDate': '30daysAgo', 'endDate': 'today'}], 'dimensions': [{'name': 'city'}], 'metrics': [{'name': 'activeUsers'}]}).encode()\nreq = urllib.request.Request('https://gateway.maton.ai/google-analytics-data/v1beta/properties/{propertyId}:runReport', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Base URLs",
        "body": "Admin API (manage accounts, properties, data streams):\n\nhttps://gateway.maton.ai/google-analytics-admin/{native-api-path}\n\nData API (run reports):\n\nhttps://gateway.maton.ai/google-analytics-data/{native-api-path}\n\nReplace {native-api-path} with the actual Google Analytics API endpoint path. The gateway proxies requests to analyticsadmin.googleapis.com and analyticsdata.googleapis.com and automatically injects your OAuth token."
      },
      {
        "title": "Authentication",
        "body": "All requests require the Maton API key in the Authorization header:\n\nAuthorization: Bearer $MATON_API_KEY\n\nEnvironment Variable: Set your API key as MATON_API_KEY:\n\nexport MATON_API_KEY=\"YOUR_API_KEY\""
      },
      {
        "title": "Getting Your API Key",
        "body": "Sign in or create an account at maton.ai\nGo to maton.ai/settings\nCopy your API key"
      },
      {
        "title": "Connection Management",
        "body": "Manage your Google OAuth connections at https://ctrl.maton.ai.\n\nImportant: The Admin API and Data API use separate connections:\n\ngoogle-analytics-admin - Required for Admin API endpoints (manage accounts, properties, data streams)\ngoogle-analytics-data - Required for Data API endpoints (run reports)\n\nCreate the connection(s) you need based on which API you want to use."
      },
      {
        "title": "List Connections",
        "body": "# List Admin API connections\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections?app=google-analytics-admin&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\n# List Data API connections\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections?app=google-analytics-data&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Create Connection",
        "body": "# Create Admin API connection (for managing accounts, properties, data streams)\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'google-analytics-admin'}).encode()\nreq = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\n# Create Data API connection (for running reports)\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'google-analytics-data'}).encode()\nreq = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Get Connection",
        "body": "python <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nResponse:\n\n{\n  \"connection\": {\n    \"connection_id\": \"21fd90f9-5935-43cd-b6c8-bde9d915ca80\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2025-12-08T07:20:53.488460Z\",\n    \"last_updated_time\": \"2026-01-31T20:03:32.593153Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"google-analytics-admin\",\n    \"metadata\": {}\n  }\n}\n\nOpen the returned url in a browser to complete OAuth authorization."
      },
      {
        "title": "Delete Connection",
        "body": "python <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Specifying Connection",
        "body": "If you have multiple Google Analytics connections, specify which one to use with the Maton-Connection header:\n\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/google-analytics-admin/v1beta/accountSummaries')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Maton-Connection', '21fd90f9-5935-43cd-b6c8-bde9d915ca80')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nIf omitted, the gateway uses the default (oldest) active connection."
      },
      {
        "title": "Accounts",
        "body": "GET /google-analytics-admin/v1beta/accounts\nGET /google-analytics-admin/v1beta/accounts/{accountId}\nGET /google-analytics-admin/v1beta/accountSummaries"
      },
      {
        "title": "Properties",
        "body": "GET /google-analytics-admin/v1beta/properties?filter=parent:accounts/{accountId}\nGET /google-analytics-admin/v1beta/properties/{propertyId}\n\nCreate Property\n\nPOST /google-analytics-admin/v1beta/properties\nContent-Type: application/json\n\n{\n  \"parent\": \"accounts/{accountId}\",\n  \"displayName\": \"My New Property\",\n  \"timeZone\": \"America/Los_Angeles\",\n  \"currencyCode\": \"USD\"\n}"
      },
      {
        "title": "Data Streams",
        "body": "GET /google-analytics-admin/v1beta/properties/{propertyId}/dataStreams\n\nCreate Web Data Stream\n\nPOST /google-analytics-admin/v1beta/properties/{propertyId}/dataStreams\nContent-Type: application/json\n\n{\n  \"type\": \"WEB_DATA_STREAM\",\n  \"displayName\": \"My Website\",\n  \"webStreamData\": {\"defaultUri\": \"https://example.com\"}\n}"
      },
      {
        "title": "Custom Dimensions",
        "body": "GET /google-analytics-admin/v1beta/properties/{propertyId}/customDimensions\n\nCreate Custom Dimension\n\nPOST /google-analytics-admin/v1beta/properties/{propertyId}/customDimensions\nContent-Type: application/json\n\n{\n  \"parameterName\": \"user_type\",\n  \"displayName\": \"User Type\",\n  \"scope\": \"USER\"\n}"
      },
      {
        "title": "Conversion Events",
        "body": "GET /google-analytics-admin/v1beta/properties/{propertyId}/conversionEvents\nPOST /google-analytics-admin/v1beta/properties/{propertyId}/conversionEvents"
      },
      {
        "title": "Run Report",
        "body": "POST /google-analytics-data/v1beta/properties/{propertyId}:runReport\nContent-Type: application/json\n\n{\n  \"dateRanges\": [{\"startDate\": \"30daysAgo\", \"endDate\": \"today\"}],\n  \"dimensions\": [{\"name\": \"city\"}],\n  \"metrics\": [{\"name\": \"activeUsers\"}]\n}"
      },
      {
        "title": "Run Realtime Report",
        "body": "POST /google-analytics-data/v1beta/properties/{propertyId}:runRealtimeReport\nContent-Type: application/json\n\n{\n  \"dimensions\": [{\"name\": \"country\"}],\n  \"metrics\": [{\"name\": \"activeUsers\"}]\n}"
      },
      {
        "title": "Batch Run Reports",
        "body": "POST /google-analytics-data/v1beta/properties/{propertyId}:batchRunReports\nContent-Type: application/json\n\n{\n  \"requests\": [\n    {\n      \"dateRanges\": [{\"startDate\": \"7daysAgo\", \"endDate\": \"today\"}],\n      \"dimensions\": [{\"name\": \"country\"}],\n      \"metrics\": [{\"name\": \"sessions\"}]\n    }\n  ]\n}"
      },
      {
        "title": "Get Metadata",
        "body": "GET /google-analytics-data/v1beta/properties/{propertyId}/metadata"
      },
      {
        "title": "Page Views by Page",
        "body": "{\n  \"dateRanges\": [{\"startDate\": \"30daysAgo\", \"endDate\": \"today\"}],\n  \"dimensions\": [{\"name\": \"pagePath\"}],\n  \"metrics\": [{\"name\": \"screenPageViews\"}],\n  \"orderBys\": [{\"metric\": {\"metricName\": \"screenPageViews\"}, \"desc\": true}],\n  \"limit\": 10\n}"
      },
      {
        "title": "Users by Country",
        "body": "{\n  \"dateRanges\": [{\"startDate\": \"30daysAgo\", \"endDate\": \"today\"}],\n  \"dimensions\": [{\"name\": \"country\"}],\n  \"metrics\": [{\"name\": \"activeUsers\"}, {\"name\": \"sessions\"}]\n}"
      },
      {
        "title": "Traffic Sources",
        "body": "{\n  \"dateRanges\": [{\"startDate\": \"30daysAgo\", \"endDate\": \"today\"}],\n  \"dimensions\": [{\"name\": \"sessionSource\"}, {\"name\": \"sessionMedium\"}],\n  \"metrics\": [{\"name\": \"sessions\"}, {\"name\": \"conversions\"}]\n}"
      },
      {
        "title": "Common Dimensions",
        "body": "date, country, city, deviceCategory\npagePath, pageTitle, landingPage\nsessionSource, sessionMedium, sessionCampaignName"
      },
      {
        "title": "Common Metrics",
        "body": "activeUsers, newUsers, sessions\nscreenPageViews, bounceRate, averageSessionDuration\nconversions, eventCount"
      },
      {
        "title": "Date Formats",
        "body": "Relative: today, yesterday, 7daysAgo, 30daysAgo\nAbsolute: 2026-01-01"
      },
      {
        "title": "JavaScript",
        "body": "// List account summaries (Admin API)\nconst accounts = await fetch(\n  'https://gateway.maton.ai/google-analytics-admin/v1beta/accountSummaries',\n  {\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    }\n  }\n);\n\n// Run a report (Data API)\nconst report = await fetch(\n  'https://gateway.maton.ai/google-analytics-data/v1beta/properties/123456:runReport',\n  {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    },\n    body: JSON.stringify({\n      dateRanges: [{ startDate: '30daysAgo', endDate: 'today' }],\n      dimensions: [{ name: 'country' }],\n      metrics: [{ name: 'activeUsers' }]\n    })\n  }\n);"
      },
      {
        "title": "Python",
        "body": "import os\nimport requests\n\n# List account summaries (Admin API)\naccounts = requests.get(\n    'https://gateway.maton.ai/google-analytics-admin/v1beta/accountSummaries',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'}\n)\n\n# Run a report (Data API)\nreport = requests.post(\n    'https://gateway.maton.ai/google-analytics-data/v1beta/properties/123456:runReport',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'},\n    json={\n        'dateRanges': [{'startDate': '30daysAgo', 'endDate': 'today'}],\n        'dimensions': [{'name': 'country'}],\n        'metrics': [{'name': 'activeUsers'}]\n    }\n)"
      },
      {
        "title": "Notes",
        "body": "GA4 properties only (Universal Analytics not supported)\nProperty IDs are numeric (e.g., properties/521310447)\nUse accountSummaries to quickly list all accessible properties\nUse updateMask for PATCH requests in Admin API\nUse metadata endpoint to discover available dimensions/metrics\nIMPORTANT: When using curl commands, use curl -g when URLs contain brackets (fields[], sort[], records[]) to disable glob parsing\nIMPORTANT: When piping curl output to jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments. You may get \"Invalid API key\" errors when piping."
      },
      {
        "title": "Error Handling",
        "body": "StatusMeaning400Missing Google Analytics connection401Invalid or missing Maton API key429Rate limited (10 req/sec per account)4xx/5xxPassthrough error from Google Analytics API"
      },
      {
        "title": "Troubleshooting: Invalid API Key",
        "body": "When you receive a \"Invalid API key\" error, ALWAYS follow these steps before concluding there is an issue:\n\nCheck that the MATON_API_KEY environment variable is set:\n\necho $MATON_API_KEY\n\nVerify the API key is valid by listing connections:\n\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Troubleshooting: Invalid App Name",
        "body": "Ensure your URL path starts with the correct app name:\n\nFor Admin API: use google-analytics-admin\nFor Data API: use google-analytics-data\n\nExamples:\n\nCorrect: https://gateway.maton.ai/google-analytics-admin/v1beta/accountSummaries\nCorrect: https://gateway.maton.ai/google-analytics-data/v1beta/properties/123456:runReport\nIncorrect: https://gateway.maton.ai/analytics/v1beta/accountSummaries"
      },
      {
        "title": "Resources",
        "body": "Admin API Overview\nAccounts\nProperties\nData Streams\nData API Overview\nRun Report\nRealtime Report\nMaton Community\nMaton Support"
      }
    ],
    "body": "Google Analytics\n\nAccess Google Analytics with managed OAuth authentication. This skill covers both the Admin API (manage accounts, properties, data streams) and the Data API (run reports on metrics).\n\nQuick Start\n# List account summaries (Admin API)\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/google-analytics-admin/v1beta/accountSummaries')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\n# Run a report (Data API)\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'dateRanges': [{'startDate': '30daysAgo', 'endDate': 'today'}], 'dimensions': [{'name': 'city'}], 'metrics': [{'name': 'activeUsers'}]}).encode()\nreq = urllib.request.Request('https://gateway.maton.ai/google-analytics-data/v1beta/properties/{propertyId}:runReport', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nBase URLs\n\nAdmin API (manage accounts, properties, data streams):\n\nhttps://gateway.maton.ai/google-analytics-admin/{native-api-path}\n\n\nData API (run reports):\n\nhttps://gateway.maton.ai/google-analytics-data/{native-api-path}\n\n\nReplace {native-api-path} with the actual Google Analytics API endpoint path. The gateway proxies requests to analyticsadmin.googleapis.com and analyticsdata.googleapis.com and automatically injects your OAuth token.\n\nAuthentication\n\nAll requests require the Maton API key in the Authorization header:\n\nAuthorization: Bearer $MATON_API_KEY\n\n\nEnvironment Variable: Set your API key as MATON_API_KEY:\n\nexport MATON_API_KEY=\"YOUR_API_KEY\"\n\nGetting Your API Key\nSign in or create an account at maton.ai\nGo to maton.ai/settings\nCopy your API key\nConnection Management\n\nManage your Google OAuth connections at https://ctrl.maton.ai.\n\nImportant: The Admin API and Data API use separate connections:\n\ngoogle-analytics-admin - Required for Admin API endpoints (manage accounts, properties, data streams)\ngoogle-analytics-data - Required for Data API endpoints (run reports)\n\nCreate the connection(s) you need based on which API you want to use.\n\nList Connections\n# List Admin API connections\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections?app=google-analytics-admin&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\n# List Data API connections\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections?app=google-analytics-data&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nCreate Connection\n# Create Admin API connection (for managing accounts, properties, data streams)\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'google-analytics-admin'}).encode()\nreq = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\n# Create Data API connection (for running reports)\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'google-analytics-data'}).encode()\nreq = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nGet Connection\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\n\nResponse:\n\n{\n  \"connection\": {\n    \"connection_id\": \"21fd90f9-5935-43cd-b6c8-bde9d915ca80\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2025-12-08T07:20:53.488460Z\",\n    \"last_updated_time\": \"2026-01-31T20:03:32.593153Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"google-analytics-admin\",\n    \"metadata\": {}\n  }\n}\n\n\nOpen the returned url in a browser to complete OAuth authorization.\n\nDelete Connection\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nSpecifying Connection\n\nIf you have multiple Google Analytics connections, specify which one to use with the Maton-Connection header:\n\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/google-analytics-admin/v1beta/accountSummaries')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Maton-Connection', '21fd90f9-5935-43cd-b6c8-bde9d915ca80')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\n\nIf omitted, the gateway uses the default (oldest) active connection.\n\nAdmin API Reference\nAccounts\nGET /google-analytics-admin/v1beta/accounts\nGET /google-analytics-admin/v1beta/accounts/{accountId}\nGET /google-analytics-admin/v1beta/accountSummaries\n\nProperties\nGET /google-analytics-admin/v1beta/properties?filter=parent:accounts/{accountId}\nGET /google-analytics-admin/v1beta/properties/{propertyId}\n\nCreate Property\nPOST /google-analytics-admin/v1beta/properties\nContent-Type: application/json\n\n{\n  \"parent\": \"accounts/{accountId}\",\n  \"displayName\": \"My New Property\",\n  \"timeZone\": \"America/Los_Angeles\",\n  \"currencyCode\": \"USD\"\n}\n\nData Streams\nGET /google-analytics-admin/v1beta/properties/{propertyId}/dataStreams\n\nCreate Web Data Stream\nPOST /google-analytics-admin/v1beta/properties/{propertyId}/dataStreams\nContent-Type: application/json\n\n{\n  \"type\": \"WEB_DATA_STREAM\",\n  \"displayName\": \"My Website\",\n  \"webStreamData\": {\"defaultUri\": \"https://example.com\"}\n}\n\nCustom Dimensions\nGET /google-analytics-admin/v1beta/properties/{propertyId}/customDimensions\n\nCreate Custom Dimension\nPOST /google-analytics-admin/v1beta/properties/{propertyId}/customDimensions\nContent-Type: application/json\n\n{\n  \"parameterName\": \"user_type\",\n  \"displayName\": \"User Type\",\n  \"scope\": \"USER\"\n}\n\nConversion Events\nGET /google-analytics-admin/v1beta/properties/{propertyId}/conversionEvents\nPOST /google-analytics-admin/v1beta/properties/{propertyId}/conversionEvents\n\nData API Reference\nRun Report\nPOST /google-analytics-data/v1beta/properties/{propertyId}:runReport\nContent-Type: application/json\n\n{\n  \"dateRanges\": [{\"startDate\": \"30daysAgo\", \"endDate\": \"today\"}],\n  \"dimensions\": [{\"name\": \"city\"}],\n  \"metrics\": [{\"name\": \"activeUsers\"}]\n}\n\nRun Realtime Report\nPOST /google-analytics-data/v1beta/properties/{propertyId}:runRealtimeReport\nContent-Type: application/json\n\n{\n  \"dimensions\": [{\"name\": \"country\"}],\n  \"metrics\": [{\"name\": \"activeUsers\"}]\n}\n\nBatch Run Reports\nPOST /google-analytics-data/v1beta/properties/{propertyId}:batchRunReports\nContent-Type: application/json\n\n{\n  \"requests\": [\n    {\n      \"dateRanges\": [{\"startDate\": \"7daysAgo\", \"endDate\": \"today\"}],\n      \"dimensions\": [{\"name\": \"country\"}],\n      \"metrics\": [{\"name\": \"sessions\"}]\n    }\n  ]\n}\n\nGet Metadata\nGET /google-analytics-data/v1beta/properties/{propertyId}/metadata\n\nCommon Report Examples\nPage Views by Page\n{\n  \"dateRanges\": [{\"startDate\": \"30daysAgo\", \"endDate\": \"today\"}],\n  \"dimensions\": [{\"name\": \"pagePath\"}],\n  \"metrics\": [{\"name\": \"screenPageViews\"}],\n  \"orderBys\": [{\"metric\": {\"metricName\": \"screenPageViews\"}, \"desc\": true}],\n  \"limit\": 10\n}\n\nUsers by Country\n{\n  \"dateRanges\": [{\"startDate\": \"30daysAgo\", \"endDate\": \"today\"}],\n  \"dimensions\": [{\"name\": \"country\"}],\n  \"metrics\": [{\"name\": \"activeUsers\"}, {\"name\": \"sessions\"}]\n}\n\nTraffic Sources\n{\n  \"dateRanges\": [{\"startDate\": \"30daysAgo\", \"endDate\": \"today\"}],\n  \"dimensions\": [{\"name\": \"sessionSource\"}, {\"name\": \"sessionMedium\"}],\n  \"metrics\": [{\"name\": \"sessions\"}, {\"name\": \"conversions\"}]\n}\n\nCommon Dimensions\ndate, country, city, deviceCategory\npagePath, pageTitle, landingPage\nsessionSource, sessionMedium, sessionCampaignName\nCommon Metrics\nactiveUsers, newUsers, sessions\nscreenPageViews, bounceRate, averageSessionDuration\nconversions, eventCount\nDate Formats\nRelative: today, yesterday, 7daysAgo, 30daysAgo\nAbsolute: 2026-01-01\nCode Examples\nJavaScript\n// List account summaries (Admin API)\nconst accounts = await fetch(\n  'https://gateway.maton.ai/google-analytics-admin/v1beta/accountSummaries',\n  {\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    }\n  }\n);\n\n// Run a report (Data API)\nconst report = await fetch(\n  'https://gateway.maton.ai/google-analytics-data/v1beta/properties/123456:runReport',\n  {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    },\n    body: JSON.stringify({\n      dateRanges: [{ startDate: '30daysAgo', endDate: 'today' }],\n      dimensions: [{ name: 'country' }],\n      metrics: [{ name: 'activeUsers' }]\n    })\n  }\n);\n\nPython\nimport os\nimport requests\n\n# List account summaries (Admin API)\naccounts = requests.get(\n    'https://gateway.maton.ai/google-analytics-admin/v1beta/accountSummaries',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'}\n)\n\n# Run a report (Data API)\nreport = requests.post(\n    'https://gateway.maton.ai/google-analytics-data/v1beta/properties/123456:runReport',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'},\n    json={\n        'dateRanges': [{'startDate': '30daysAgo', 'endDate': 'today'}],\n        'dimensions': [{'name': 'country'}],\n        'metrics': [{'name': 'activeUsers'}]\n    }\n)\n\nNotes\nGA4 properties only (Universal Analytics not supported)\nProperty IDs are numeric (e.g., properties/521310447)\nUse accountSummaries to quickly list all accessible properties\nUse updateMask for PATCH requests in Admin API\nUse metadata endpoint to discover available dimensions/metrics\nIMPORTANT: When using curl commands, use curl -g when URLs contain brackets (fields[], sort[], records[]) to disable glob parsing\nIMPORTANT: When piping curl output to jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments. You may get \"Invalid API key\" errors when piping.\nError Handling\nStatus\tMeaning\n400\tMissing Google Analytics connection\n401\tInvalid or missing Maton API key\n429\tRate limited (10 req/sec per account)\n4xx/5xx\tPassthrough error from Google Analytics API\nTroubleshooting: Invalid API Key\n\nWhen you receive a \"Invalid API key\" error, ALWAYS follow these steps before concluding there is an issue:\n\nCheck that the MATON_API_KEY environment variable is set:\necho $MATON_API_KEY\n\nVerify the API key is valid by listing connections:\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nTroubleshooting: Invalid App Name\nEnsure your URL path starts with the correct app name:\nFor Admin API: use google-analytics-admin\nFor Data API: use google-analytics-data\n\nExamples:\n\nCorrect: https://gateway.maton.ai/google-analytics-admin/v1beta/accountSummaries\nCorrect: https://gateway.maton.ai/google-analytics-data/v1beta/properties/123456:runReport\nIncorrect: https://gateway.maton.ai/analytics/v1beta/accountSummaries\nResources\nAdmin API Overview\nAccounts\nProperties\nData Streams\nData API Overview\nRun Report\nRealtime Report\nMaton Community\nMaton Support"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/byungkyu/google-analytics",
    "publisherUrl": "https://clawhub.ai/byungkyu/google-analytics",
    "owner": "byungkyu",
    "version": "1.0.10",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/google-analytics",
    "downloadUrl": "https://openagent3.xyz/downloads/google-analytics",
    "agentUrl": "https://openagent3.xyz/skills/google-analytics/agent",
    "manifestUrl": "https://openagent3.xyz/skills/google-analytics/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/google-analytics/agent.md"
  }
}