Google Analytics

How to approach a Google Analytics integration in this repo.

This repository does not currently ship a Google Analytics provider package or a prewired GA4 integration.

Current State

  • No @kit/google-analytics package is present in packages/
  • @kit/analytics currently registers only the null provider
  • There is no checked-in GA4 codemod or plugin wiring in this repo

What To Do Instead

If you want Google Analytics in this codebase:

  1. Create a provider that implements AnalyticsService
  2. Register it in packages/analytics/src/index.ts
  3. Add any browser script/bootstrap logic inside that provider
  4. Mirror the setup in packages/analytics/src/server.ts only if you also need server-side forwarding

Use Custom Analytics Provider as the reference pattern.

Google Analytics is a good fit when you need:

  • marketing attribution
  • ad campaign reporting
  • basic page-view and conversion tracking

If you need a production-ready integration, plan to own the package, env vars, consent handling, and any GA-specific event mapping yourself.