bootstrap-google-analytics

Installation
SKILL.md

Bootstrap Google Analytics (GA4)

Configure Google Analytics 4 with gtag.js in a Phoenix 1.8 app — disabled in dev/test, enabled in production via environment variable.

What Gets Configured

  1. config.exs — GA disabled by default with enabled: false, measurement_id: nil
  2. runtime.exs — GA enabled in production with GOOGLE_ANALYTICS_MEASUREMENT_ID env var
  3. root.html.heex — Conditional gtag.js script injection
  4. .env.sample — GOOGLE_ANALYTICS_MEASUREMENT_ID entry

App Name Detection

Detect from mix.exs:

  • App module prefix (e.g., MyApp) — the module namespace
  • OTP app name (e.g., :my_app) — used in config atoms
  • Web module prefix (e.g., MyAppWeb) — for layout references
Installs
3
GitHub Stars
1
First Seen
May 21, 2026