Skip to content

Add GA referrals and crawl observations to brand workspaces - #26

Merged
erickkkyt merged 3 commits into
mainfrom
codex/ga-crawl-sources
Oct 26, 2026
Merged

erickkkyt merged 3 commits into
mainfrom
codex/ga-crawl-sources

Conversation

@erickkkyt

Copy link
Copy Markdown
Contributor

Brand workspaces can inspect AI answer evidence but lack the site's AI referral visits and crawler requests. Add an AI Traffic & Crawls page that reuses existing GA4 analytics and imports site-specific access logs, with those measures kept separate from mentions and citations.

  • Connect Google through web OAuth with analytics.readonly, session-bound state/PKCE, brand-bound encrypted grants, property selection and manual refresh of the last 28 completed days.
  • Show platform sessions, engagement, configured key events, landing pages and source evidence. Supplement the native AI Assistant channel with explicit platform domains and retain GA data-limit warnings.
  • Import Combined/JSON/JSONL logs with hostname/size validation, declared crawler purposes, HTTP responses and bounded evidence; discard IPs, full UAs, referrers and query strings before persistence.
  • Reuse organization access, existing PostgreSQL and shared UI components; include English/Chinese states and migration 0028 for one brand-scoped source table.

Validation: repository lint and all workspace type checks passed; 1,560 workspace unit tests, 49 disposable-PostgreSQL integration tests and 7 Storybook interaction tests passed. Production web build passed. Desktop and 390px English/Chinese component states were checked in Chromium without page overflow.

Operational prerequisites: configure the deployment's Google Web OAuth client, enable Analytics Admin/Data APIs and register APP_URL/api/traffic/ga/callback. Real Google consent/Data API acceptance remains pending; browser access to GA is not treated as product authorization. Existing user databases were not migrated, and no external account settings or deployments were changed.

@erickkkyt
erickkkyt merged commit 50572ce into main Oct 26, 2026
3 checks passed
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