Skip to content

Integrations: Google Analytics (GA4) connection via Composio — Phase 1 #658

Closed

Description

@gkhngyk

Goal

Add Google Analytics as the second provider in Settings → Integrations, reusing the Composio managed-auth plumbing built for Google Search Console (#577). This phase is connection only: connect, show status, disconnect. Property mapping, data sync, and product surfaces (AI-traffic history without the tracking snippet, conversion metrics, citations enrichment) are later phases.

Why

Today the AI Traffic page depends entirely on the customer installing our tracking snippet — until then it's empty. A GA4 connection is the gateway to pulling AI-sourced sessions (and later conversions) straight from data customers already have, with months of history and zero code changes on their site. Phase 1 lands the connect flow so the data phases can build on it.

What exists already

The plumbing was deliberately built provider-generic:

Scope

  • Generalize the provider-specific parts of composio.js / integrations.js (auth-config id, PROVIDER constant) so a second provider slots in cleanly — e.g. a small per-provider config map instead of copy-pasting the route set.
  • New env: COMPOSIO_GA_AUTH_CONFIG_ID (documented in server/.env.example). Same no-op guarantee as GSC: when Composio env vars are absent, everything reports "not configured" and nothing breaks — self-host stays safe.
  • Composio entity stays org_<organizationId> (one Google account connection per org per provider).
  • Settings → Integrations shows a Google Analytics card next to Search Console: Connect (OAuth via Composio link flow), Connected status with account e-mail, Disconnect.
  • Connect/callback/status/disconnect endpoints for the new provider, mirroring GSC's.

Out of scope (later phases)

  • GA4 property listing + brand ↔ property mapping (Phase 2, mirrors GSC property mapping)
  • Daily report sync + storage (Phase 2)
  • AI Traffic page / conversions / citations surfaces (Phase 3)

Acceptance criteria

  • An org admin can connect a Google Analytics account from Settings → Integrations and see the connected state persist across reloads; disconnect removes it.
  • GSC connection behavior is completely unaffected.
  • With Composio env vars unset, both cards degrade to the existing "not configured" state.

Activity

  1. added
    enhancement
    on Aug 7, 2026
  2. self-assigned this
    on Aug 7, 2026
  3. added a commit that references this issue on Aug 10, 2026
    b0a24a4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions