{"id":"24c76934-cd2b-4e6f-aff9-01d4879c74d6","shortId":"LfZFV6","kind":"skill","title":"ga4","tagline":"Query Google Analytics 4 (GA4) data via the Analytics Data API. Use when you need to pull website analytics like top pages, traffic sources, user counts, sessions, conversions, or any GA4 metrics/dimensions. Supports custom date ranges and filtering.","description":"# GA4 - Google Analytics 4 Data API\n\nQuery GA4 properties for analytics data: page views, sessions, users, traffic sources, conversions, and more.\n\n## Setup (one-time)\n\n1. Enable Google Analytics Data API: https://console.cloud.google.com/apis/library/analyticsdata.googleapis.com\n2. Create OAuth credentials or use existing Google Cloud project\n3. Set environment variables:\n   - `GA4_PROPERTY_ID` - Your GA4 property ID (numeric, e.g., \"123456789\")\n   - `GOOGLE_CLIENT_ID` - OAuth client ID\n   - `GOOGLE_CLIENT_SECRET` - OAuth client secret\n   - `GOOGLE_REFRESH_TOKEN` - OAuth refresh token (from initial auth flow)\n\n## Common Queries\n\n### Top Pages (by pageviews)\n```bash\npython3 scripts/ga4_query.py --metric screenPageViews --dimension pagePath --limit 30\n```\n\n### Top Pages with Sessions & Users\n```bash\npython3 scripts/ga4_query.py --metrics screenPageViews,sessions,totalUsers --dimension pagePath --limit 20\n```\n\n### Traffic Sources\n```bash\npython3 scripts/ga4_query.py --metric sessions --dimension sessionSource --limit 20\n```\n\n### Landing Pages\n```bash\npython3 scripts/ga4_query.py --metric sessions --dimension landingPage --limit 30\n```\n\n### Custom Date Range\n```bash\npython3 scripts/ga4_query.py --metric sessions --dimension pagePath --start 2026-01-01 --end 2026-01-15\n```\n\n### Filter by Page Path\n```bash\npython3 scripts/ga4_query.py --metric screenPageViews --dimension pagePath --filter \"pagePath=~/blog/\"\n```\n\n## Available Metrics\n\nCommon metrics: `screenPageViews`, `sessions`, `totalUsers`, `newUsers`, `activeUsers`, `bounceRate`, `averageSessionDuration`, `conversions`, `eventCount`\n\n## Available Dimensions\n\nCommon dimensions: `pagePath`, `pageTitle`, `landingPage`, `sessionSource`, `sessionMedium`, `sessionCampaignName`, `country`, `city`, `deviceCategory`, `browser`, `date`\n\n## Output Formats\n\nDefault: Table format\nAdd `--json` for JSON output\nAdd `--csv` for CSV output","tags":["ga4","agent","skills","jdrhyne","agent-skills","agentic-ai","ai-agents","automation","claude-code","clawdbot","codex","cursor"],"capabilities":["skill","source-jdrhyne","skill-ga4","topic-agent-skills","topic-agentic-ai","topic-ai-agents","topic-automation","topic-claude-code","topic-clawdbot","topic-codex","topic-cursor","topic-developer-tools","topic-gemini-cli","topic-github-copilot","topic-llm-agents"],"categories":["agent-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/jdrhyne/agent-skills/ga4","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add jdrhyne/agent-skills","source_repo":"https://github.com/jdrhyne/agent-skills","install_from":"skills.sh"}},"qualityScore":"0.565","qualityRationale":"deterministic score 0.56 from registry signals: · indexed on github topic:agent-skills · 230 github stars · SKILL.md body (1,903 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T00:54:18.971Z","embedding":null,"createdAt":"2026-04-18T22:04:56.825Z","updatedAt":"2026-04-22T00:54:18.971Z","lastSeenAt":"2026-04-22T00:54:18.971Z","tsv":"'-01':185,186,189 '-15':190 '/apis/library/analyticsdata.googleapis.com':73 '/blog':204 '1':65 '123456789':97 '2':74 '20':150,161 '2026':184,188 '3':84 '30':134,172 '4':5,43 'activeus':213 'add':238,243 'analyt':4,10,20,42,50,68 'api':12,45,70 'auth':118 'avail':205,218 'averagesessiondur':215 'bash':126,140,153,164,176,195 'bouncer':214 'browser':231 'citi':229 'client':99,102,105,108 'cloud':82 'common':120,207,220 'console.cloud.google.com':72 'console.cloud.google.com/apis/library/analyticsdata.googleapis.com':71 'convers':29,58,216 'count':27 'countri':228 'creat':75 'credenti':77 'csv':244,246 'custom':35,173 'data':7,11,44,51,69 'date':36,174,232 'default':235 'devicecategori':230 'dimens':131,147,158,169,181,200,219,221 'e.g':96 'enabl':66 'end':187 'environ':86 'eventcount':217 'exist':80 'filter':39,191,202 'flow':119 'format':234,237 'ga4':1,6,32,40,47,88,92 'googl':3,41,67,81,98,104,110 'id':90,94,100,103 'initi':117 'json':239,241 'land':162 'landingpag':170,224 'like':21 'limit':133,149,160,171 'metric':129,143,156,167,179,198,206,208 'metrics/dimensions':33 'need':16 'newus':212 'numer':95 'oauth':76,101,107,113 'one':63 'one-tim':62 'output':233,242,247 'page':23,52,123,136,163,193 'pagepath':132,148,182,201,203,222 'pagetitl':223 'pageview':125 'path':194 'project':83 'properti':48,89,93 'pull':18 'python3':127,141,154,165,177,196 'queri':2,46,121 'rang':37,175 'refresh':111,114 'screenpageview':130,144,199,209 'scripts/ga4_query.py':128,142,155,166,178,197 'secret':106,109 'session':28,54,138,145,157,168,180,210 'sessioncampaignnam':227 'sessionmedium':226 'sessionsourc':159,225 'set':85 'setup':61 'skill' 'skill-ga4' 'sourc':25,57,152 'source-jdrhyne' 'start':183 'support':34 'tabl':236 'time':64 'token':112,115 'top':22,122,135 'topic-agent-skills' 'topic-agentic-ai' 'topic-ai-agents' 'topic-automation' 'topic-claude-code' 'topic-clawdbot' 'topic-codex' 'topic-cursor' 'topic-developer-tools' 'topic-gemini-cli' 'topic-github-copilot' 'topic-llm-agents' 'totalus':146,211 'traffic':24,56,151 'use':13,79 'user':26,55,139 'variabl':87 'via':8 'view':53 'websit':19","prices":[{"id":"233978d9-0603-4785-9a95-7729f2f88207","listingId":"24c76934-cd2b-4e6f-aff9-01d4879c74d6","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"jdrhyne","category":"agent-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T22:04:56.825Z"}],"sources":[{"listingId":"24c76934-cd2b-4e6f-aff9-01d4879c74d6","source":"github","sourceId":"jdrhyne/agent-skills/ga4","sourceUrl":"https://github.com/jdrhyne/agent-skills/tree/main/skills/ga4","isPrimary":false,"firstSeenAt":"2026-04-18T22:04:56.825Z","lastSeenAt":"2026-04-22T00:54:18.971Z"}],"details":{"listingId":"24c76934-cd2b-4e6f-aff9-01d4879c74d6","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"jdrhyne","slug":"ga4","github":{"repo":"jdrhyne/agent-skills","stars":230,"topics":["agent-skills","agentic-ai","ai-agents","automation","claude-code","clawdbot","codex","cursor","developer-tools","gemini-cli","github-copilot","llm-agents","mcp","openclaw","prompt-engineering","prompts"],"license":null,"html_url":"https://github.com/jdrhyne/agent-skills","pushed_at":"2026-03-27T14:29:53Z","description":"A collection of AI agent skills for Clawdbot, Claude Code, Codex","skill_md_sha":"2ab56c96ff33f4aa0cdad73f2debf6ea5107e838","skill_md_path":"skills/ga4/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/jdrhyne/agent-skills/tree/main/skills/ga4"},"layout":"multi","source":"github","category":"agent-skills","frontmatter":{"name":"ga4","description":"Query Google Analytics 4 (GA4) data via the Analytics Data API. Use when you need to pull website analytics like top pages, traffic sources, user counts, sessions, conversions, or any GA4 metrics/dimensions. Supports custom date ranges and filtering."},"skills_sh_url":"https://skills.sh/jdrhyne/agent-skills/ga4"},"updatedAt":"2026-04-22T00:54:18.971Z"}}