Google Analytics
See which channels and ads bring leads, calls and sales, in a report you read in one minute.
- GA4
- Consent mode
- Key events
Install
npx skills add webrenew/skills --skill google-analytics4 files · 565 lines · any agent that reads SKILL.md
Use it when
- You count visits but not leads, calls or bookings
- Conversions look doubled, or are missing
- You start ads and need to know which ones pay
What your agent delivers
- GA4 that counts each lead, call, booking and sale once
- Consent mode that follows the site's cookie banner
- A five-line weekly report for the owner
Source files
Read every line before you install. Copy or download one file.
SKILL.md
205 lines
---
name: google-analytics
description: >
Set up, fix or audit Google Analytics 4 (GA4) for a small business website so the owner can
see which channels and ads bring leads, calls, bookings and sales. Use this skill for a new
GA4 property or data stream, the Google tag or gtag.js, @next/third-parties, consent mode v2
and the cookie banner, key events and conversions, UTM links, linking Google Ads or Search
Console, enhanced conversions, DebugView or Tag Assistant, and when the user says "set up
Google Analytics", "GA4 is not tracking", "conversions are doubled", "which ads bring
leads", "track form submissions" or "weekly analytics report".
---
# Google Analytics: Count the Leads, Not Only the Visits
**RULE: Each key event fires once, only after the server confirms success, only with the
visitor's consent, and never with personal data in it.**
A small business does not need 40 reports. It needs one answer each week: how many leads,
calls, bookings and sales came in, and from which channel. Everything in this skill serves
that answer and the ad platforms that learn from it (`google-ads`, `meta-ads`).
## 1. Own the property
- The **owner's** Google account owns the GA4 account and property. The agency gets
Administrator or Editor access on the property. Never build the property in an agency
account: the owner loses the history when the agency leaves.
- One property per business, one **Web** data stream per site. Copy the Measurement ID
(`G-XXXXXXX`); it is public and goes in the page.
- Admin settings to change on day one:
| Setting | Value | Why |
|---|---|---|
| Data retention (Data collection and modification) | 14 months | The default of 2 months removes year-over-year comparisons in Explorations |
| Reporting time zone and currency | The business's own | Days and values match the owner's books |
| Internal traffic rule, then the filter set to **Active** | Office and agency IP addresses | Staff visits do not count as customers |
| Unwanted referrals (data stream, Configure tag settings) | Payment and booking domains, for example `checkout.stripe.com` | A return from checkout stays in the original session and channel |
| Enhanced measurement: **Form interactions** | Off | It fires on every submit, also failed ones. The site sends `generate_lead` after success instead |
| Enhanced measurement: page changes based on browser history events | On | Single-page apps (Next.js) get one page view per route change without extra code |
| Data redaction (data stream) | Email on, plus query parameters such as `email`, `phone`, `name` | A safety net if a form ever puts personal data in a URL |
## 2. Install the tag once
Use exactly one install path. Two paths (for example the Next.js component plus a Google Tag
Manager container that also has GA4) send every page view twice.
- **Next.js:** `@next/third-parties` `GoogleAnalytics` in the root layout, or `gtag.js` with
`next/script`. Do not send `page_view` manually on route change: enhanced measurement
already does it.
- **Other sites (WordPress, Webflow, static HTML, Shopify):** the Google tag snippet in
`<head>`, or the platform's own GA4 field. Not both.
Code for both paths, the consent default and the event helper is in
[references/implementation.md](references/implementation.md).
## 3. Consent mode v2: respect the banner
Consent mode tells Google tags what the visitor agreed to. It has four signals:
`analytics_storage`, `ad_storage`, `ad_user_data` and `ad_personalization`.
1. Find the site's consent banner (Cookiebot, CookieYes, OneTrust, Termly, or a custom one).
Related skills
All skills- 07
Google Ads
PPC packgoogle-ads
Pay only for searches that can become customers, and approve every change that costs money.
Pay only for searches that can become customers, and approve every change that costs money.
- 08
Meta Ads
PPC packmeta-ads
Facebook and Instagram ads from real jobs that bring local leads, with tracking that respects consent.
Facebook and Instagram ads from real jobs that bring local leads, with tracking that respects consent.
- 01
Make each page clear to search engines. Give them a path to every link.
- 02
Local SEO
Launch packlaunch-local-seo
Get found by customers nearby, in local search and on Google Maps.
Get found by customers nearby, in local search and on Google Maps.