Skip to content

feat(analytics): add Google Analytics and Google Search Console commands#402

Open
haresh-seenivasagan wants to merge 2 commits intosteipete:mainfrom
haresh-seenivasagan:feat/analytics-searchconsole-tests
Open

feat(analytics): add Google Analytics and Google Search Console commands#402
haresh-seenivasagan wants to merge 2 commits intosteipete:mainfrom
haresh-seenivasagan:feat/analytics-searchconsole-tests

Conversation

@haresh-seenivasagan
Copy link

@haresh-seenivasagan haresh-seenivasagan commented Mar 3, 2026

Motivation

I wanted to give my companies Claw🦞 access to Google Analytics and Search Console data for SEO audits and traffic analysis.

Summary

Command What it does
gog analytics accounts List GA4 account summaries (--all for pagination)
gog analytics report <property> Run a GA4 report (dimensions, metrics, date ranges)
gog searchconsole sites List Search Console properties
gog searchconsole query <siteUrl> Run Search Analytics queries

Both read-only. Aliases: ga, gsc.

gog analytics accounts --all --json
gog analytics report 123456789 --from 7daysAgo --to today --dimensions date,country --metrics activeUsers,sessions
gog searchconsole sites
gog searchconsole query sc-domain:example.com --from 2026-02-01 --to 2026-02-07 --dimensions query,page --type WEB

Follows existing patterns (collectAllPages, tableWriter, failEmptyExit, same flag names). Property IDs normalized so 123456789 and properties/123456789 both work.

Tests

16 integration tests covering JSON + text output for all 4 subcommands, --all pagination, --fail-empty, input validation before API calls, and service init failures.

go test ./...  # full suite passes

haresh-seenivasagan pushed a commit to haresh-seenivasagan/gogcli that referenced this pull request Mar 3, 2026
@haresh-seenivasagan haresh-seenivasagan changed the title feat(analytics): add GA4 and Search Console commands feat(analytics): add GA4 and Google Search Console commands Mar 3, 2026
@haresh-seenivasagan haresh-seenivasagan changed the title feat(analytics): add GA4 and Google Search Console commands feat(analytics): add Google Analytics and Google Search Console commands Mar 3, 2026
@haresh-seenivasagan haresh-seenivasagan force-pushed the feat/analytics-searchconsole-tests branch from 6beeef1 to b82cc1a Compare March 3, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant