native-google-analyticsQuery Google Analytics 4 (GA4) data directly via the Analytics Data API. Use when you need website analytics like top pages, traffic sources, sessions, users...
Install via ClawdBot CLI:
clawdbot install codeninja23/native-google-analyticsQuery GA4 properties directly via the Google Analytics Data API (analyticsdata.googleapis.com).
Go to https://console.cloud.google.com and create or select a project.
Go to APIs & Credentials > OAuth consent screen > Audience and set:
This avoids Google's app verification process (which requires a demo video for sensitive scopes like Analytics). Internal is fine for personal/team use. Note: this requires a Google Workspace account (not a personal @gmail.com).
If you must use External (e.g. you have a personal Gmail), set publishing status to "In production" and add the analytics.readonly scope under Data Access / Scopes.
Go to OAuth consent screen > Data Access (or Scopes) and add:
https://www.googleapis.com/auth/analytics.readonly
This is listed as a "sensitive scope" by Google. If your app is Internal, no verification is needed.
Go to: https://console.cloud.google.com/apis/library/analyticsdata.googleapis.com
Click Enable.
Go to APIs & Credentials > Credentials > Create Credentials > OAuth client ID
Save the Client ID and Client Secret.
Go to https://analytics.google.com > Admin (gear icon) > Property Settings. The Property ID is the numeric value at the top.
Run this on your local machine (needs a browser for the Google login flow):
pip install google-auth-oauthlib
python3 -c "from google_auth_oauthlib.flow import InstalledAppFlow; flow = InstalledAppFlow.from_client_config({'installed': {'client_id': 'YOUR_CLIENT_ID', 'client_secret': 'YOUR_CLIENT_SECRET', 'auth_uri': 'https://accounts.google.com/o/oauth2/auth', 'token_uri': 'https://oauth2.googleapis.com/token'}}, scopes=['https://www.googleapis.com/auth/analytics.readonly']); creds = flow.run_local_server(port=0); print('REFRESH TOKEN:', creds.refresh_token)"
Replace YOUR_CLIENT_ID and YOUR_CLIENT_SECRET with your values. A browser window will open for you to log in with Google. Copy the refresh token from the output.
GA4_PROPERTY_ID=123456789
GOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-client-secret
GOOGLE_REFRESH_TOKEN=your-refresh-token
analytics.readonly scope is probably not added to your OAuth consent screen. Go to Data Access/Scopes and add it, then regenerate your refresh token.python3 /mnt/skills/user/google-analytics/scripts/ga4_query.py \
--metrics screenPageViews \
--dimension pagePath \
--limit 20
python3 /mnt/skills/user/google-analytics/scripts/ga4_query.py \
--metrics screenPageViews,sessions,totalUsers \
--dimension pagePath \
--limit 20
python3 /mnt/skills/user/google-analytics/scripts/ga4_query.py \
--metrics sessions \
--dimension sessionSource \
--limit 20
python3 /mnt/skills/user/google-analytics/scripts/ga4_query.py \
--metrics sessions,totalUsers,conversions \
--dimensions sessionSource,sessionMedium \
--limit 20
python3 /mnt/skills/user/google-analytics/scripts/ga4_query.py \
--metrics sessions,bounceRate \
--dimension landingPage \
--limit 30
python3 /mnt/skills/user/google-analytics/scripts/ga4_query.py \
--metrics screenPageViews,sessions \
--dimension pagePath \
--start 2026-01-01 \
--end 2026-01-31 \
--limit 20
python3 /mnt/skills/user/google-analytics/scripts/ga4_query.py \
--metrics screenPageViews,sessions \
--dimension pagePath \
--filter "pagePath=~/blog/" \
--limit 20
python3 /mnt/skills/user/google-analytics/scripts/ga4_query.py \
--metrics conversions,sessions \
--dimensions sessionCampaignName,sessionSource \
--limit 20
python3 /mnt/skills/user/google-analytics/scripts/ga4_query.py \
--metrics sessions,totalUsers \
--dimension deviceCategory \
--limit 10
python3 /mnt/skills/user/google-analytics/scripts/ga4_query.py \
--metrics sessions,totalUsers \
--dimension country \
--limit 20
screenPageViews, sessions, totalUsers, newUsers, activeUsers, bounceRate, averageSessionDuration, conversions, eventCount, engagementRate, userEngagementDuration
pagePath, pageTitle, landingPage, sessionSource, sessionMedium, sessionCampaignName, country, city, deviceCategory, browser, date, week, month
Results are printed as a formatted table to stdout. Pipe to | python3 -m json.tool if you need raw JSON.
Generated Mar 1, 2026
A digital media company uses this skill to analyze top-performing articles by pageviews and sessions, identify traffic sources like social media or search engines, and measure bounce rates to optimize content strategy. It helps editors prioritize topics and improve user engagement by understanding reader behavior across different landing pages.
An e-commerce business leverages this skill to monitor conversions by campaign, track device breakdowns to optimize mobile shopping experiences, and analyze traffic sources to allocate marketing budgets effectively. It enables data-driven decisions to boost sales by identifying high-performing campaigns and user segments.
A marketing agency employs this skill to evaluate campaign performance by measuring sessions, users, and conversions across sources and mediums, using custom date ranges for specific promotions. It provides clients with actionable insights to refine ad spend and improve targeting based on real-time analytics data.
A SaaS company utilizes this skill to track active users, engagement rates, and session durations by country and device category, helping identify growth opportunities and technical issues. It supports product development by revealing how users interact with the platform across different regions and devices.
A small business owner uses this skill to analyze top pages, traffic sources, and bounce rates to enhance website usability and attract more customers. By filtering data for specific sections like blogs, they can tailor content and marketing efforts to increase local or niche market reach.
Companies offering analytics dashboards or reporting tools as a service can integrate this skill to provide clients with direct GA4 data access, enhancing their product value. It enables automated reporting and real-time insights, driving recurring revenue through premium features and data-driven consulting.
Marketing or analytics agencies use this skill to deliver customized reports and strategic advice based on GA4 metrics, charging clients for setup, ongoing analysis, and optimization services. It supports scalable service offerings by automating data retrieval and focusing on high-value insights.
Online retailers and affiliate marketers leverage this skill to track conversions and traffic sources, optimizing ad campaigns and content to maximize sales commissions or direct revenue. It helps identify profitable channels and improve conversion rates through data-backed decisions.
š¬ Integration Tip
Ensure all required environment variables are set correctly and regenerate refresh tokens if authentication errors occur; use custom date ranges and filters in queries to tailor data extraction for specific business needs.
Quick system diagnostics: CPU, memory, disk, uptime
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, ses...
Google Analytics 4, Search Console, and Indexing API toolkit. Analyze website traffic, page performance, user demographics, real-time visitors, search queries, and SEO metrics. Use when the user asks to: check site traffic, analyze page views, see traffic sources, view user demographics, get real-time visitor data, check search console queries, analyze SEO performance, request URL re-indexing, inspect index status, compare date ranges, check bounce rates, view conversion data, or get e-commerce revenue. Requires a Google Cloud service account with GA4 and Search Console access.
Google Analytics API integration with managed OAuth. Manage accounts, properties, and data streams (Admin API). Run reports on sessions, users, page views, and conversions (Data API). Use this skill when users want to configure or query Google Analytics. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).
Deploy privacy-first analytics with correct API patterns, rate limits, and GDPR compliance.
Google Analytics 4, Search Console, and Indexing API toolkit. Analyze website traffic, page performance, user demographics, real-time visitors, search queries, and SEO metrics. Use when the user asks to: check site traffic, analyze page views, see traffic sources, view user demographics, get real-time visitor data, check search console queries, analyze SEO performance, request URL re-indexing, inspect index status, compare date ranges, check bounce rates, view conversion data, or get e-commerce revenue. Requires a Google Cloud service account with GA4 and Search Console access.