aws-spa-deploy
Use this skill whenever the user is deploying a React/Vite single-page app to AWS, or mentions Amplify Hosting, amplify.yml, CDK,…
Use this skill whenever the user installs, configures, or debugs Google Analytics 4, or mentions gtag.js, the Google tag, GTM, key events or conversion tracking, e-commerce events, DebugView or Tag Assistant, or a cookie/consent banner tied to analytics. Covers installation
Claude Code
$ npx -y skills add ziniman/ai-instruct --skill google-analytics-4 --agent claude-code
Codex
$ npx skills add ziniman/ai-instruct --skill google-analytics-4 -a codex -y
Cursor
$ npx skills add ziniman/ai-instruct --skill google-analytics-4 -a cursor -y
Gemini CLI
$ npx skills add ziniman/ai-instruct --skill google-analytics-4 -a gemini-cli -y
GitHub Copilot
$ npx skills add ziniman/ai-instruct --skill google-analytics-4 -a github-copilot -y
OpenCode
$ npx skills add ziniman/ai-instruct --skill google-analytics-4 -a opencode -y
Windsurf
$ npx skills add ziniman/ai-instruct --skill google-analytics-4 -a windsurf -y
name: google-analytics-4 description: 'Use this skill whenever the user installs, configures, or debugs Google Analytics 4, or mentions gtag.js, the Google tag, GTM, key events or conversion tracking, e-commerce events, DebugView or Tag Assistant, or a cookie/consent banner tied to analytics. Covers installation (including Google tag gateway first-party serving), first-time setup (data retention, internal and hostname filters, key events), event tracking, user properties, e-commerce, Consent Mode v2 for EEA/UK/Swiss visitors, SPA pageview tracking, and BigQuery export. Skip for other analytics products (Plausible, Mixpanel, PostHog, Segment), Universal Analytics (sunset 2024), or server-side-only tracking.'
> Applies to: Any website or web app | Updated: October 2026
A practical guide for implementing Google Analytics 4 (GA4) - covering installation, critical first-time setup, event tracking, e-commerce, consent, and advanced topics. Written for AI coding assistants: skip sections that don't apply to the user's setup.
> **Note:** Universal Analytics (UA / GA3) was fully sunset in 2024. GA4 is the only current Google Analytics product.
---
Answer these questions before writing any code. They determine which sections apply.
**Q: Are any of your visitors in the EU/EEA (European Economic Area), the UK, or Switzerland?** Default: no - if yes, Consent Mode v2 setup is required (see [Consent Mode v2](references/consent-mode-v2.md))
**Q: Do you run Google Ads (search, display, YouTube, or Shopping)?** Default: no - if yes, ad consent signals matter for conversion tracking and which events you mark as key events and use as Ads conversions
**Q: Is your site a single-page app (React, Vue, Angular, Next.js, etc.) where the URL changes without a full page reload?** Default: check `package.json` for a client-side router (`react-router-dom`, `vue-router`, `@angular/router`, `next`, `nuxt`, `@sveltejs/kit`) - if found, assume SPA and apply the [Single-Page Apps](references/single-page-apps.md) section automatically
**Q: Do you need to track purchases or sales?** Default: no - skip [E-commerce Tracking](references/e-commerce-tracking.md) if no
**Q: Do you already have a GA4 property, or is this a fresh start?** Default: fresh start - if fresh start, create a property at analytics.google.com before writing any code
**Q: Do you use Google Tag Manager, or add the tracking code directly?** Default: direct gtag.js - recommend GTM only if the user has a marketing team managing multiple tags
> **AI assistant:** Use these answers to skip irrelevant sections. Do not implement Consent Mode unless the user confirms EEA, UK, or Swiss users, and do not implement e-commerce unless confirmed. If a SPA framework is detected, apply the SPA section and pick exactly one page_view approach (never manual `page_view` calls while the Enhanced Measurement history setting is still on); do not add `anonymize_ip`, which is a no-op in GA4 (see [Common Pitfalls](references/common-pitfalls.md)).
---
This guide is split into reference files. Use the Section 0 answers to decide which apply, then read only those; skip the rest.
Turn your AI assistant into a senior web developer. Production-ready guides for SEO, performance, agent-readiness, and more.
Use this skill whenever the user is deploying a React/Vite single-page app to AWS, or mentions Amplify Hosting, amplify.yml, CDK,…
Use this skill whenever the user is building, reviewing, or launching a public website or web app; SEO, LLMO, and agent-readiness…
Use this skill whenever the user is building or reviewing any web UI. Accessibility is a baseline requirement, not a niche…
Use this skill whenever the user is improving Core Web Vitals or page load performance, or mentions slow pages, PageSpeed…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.