Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Sets up Google Analytics 4 tracking in a project by detecting its framework and adding tracking code, events, and privacy settings.
Use this skill ↓41% 73%+32 ptsof test cases passed
Passed 16 of 22 test cases with the skill, and 9 of 22 without it.
3 of 3 safety checks passed
Not used yet
You are setting up Google Analytics 4 (GA4) for a project. Follow this comprehensive guide to add analytics properly.
Parse the following from $ARGUMENTS:
G-XXXXXXXXXX (required, ask if not provided)Scan the project to determine the framework/setup:
Priority detection order:
1. next.config.js/ts → Next.js
2. nuxt.config.js/ts → Nuxt.js
3. astro.config.mjs → Astro
4. svelte.config.js → SvelteKit
5. remix.config.js → Remix
6. gatsby-config.js → Gatsby
7. vite.config.js + src/App.vue → Vue + Vite
8. vite.config.js + src/App.tsx → React + Vite
9. angular.json → Angular
10. package.json with "react-scripts" → Create React App
11. index.html only → Plain HTML
12. _app.tsx/jsx → Next.js (App Router check: app/ directory)
Also check for:
The Measurement ID must:
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.