Skip to content
Skills Library
Data & analytics · Planning

web-analytics

/web-analytics

Measure a site accurately, lawfully and lightly: analytics, tags, events, conversions and consent. Use when setting up GA4 with Google Tag Manager or Consent Mode v2, choosing a privacy-first tool (Plausible, Umami, Matomo, PostHog, Cloudflare), designing an event and conversion taxonomy with UTM and cross-domain rules, filtering bot and internal traffic, planning a consent banner and cookie inventory for GDPR, UK PECR, India DPDP, California CPRA or Global Privacy Control, or joining Search Console and Bing data. Audits the delivered HTML for trackers that fire before consent. Triggers on GA4

Repository
ai-skill-ai ↗
Licence
MIT
Last repository change
31.10.2026

Assessment and security

98/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene13 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
1
HTML comments
1
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 31.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.
  • SKILL.md zawiera komentarze HTML (1). Nie widać ich w podglądzie Markdown, a model je czyta.

Scripts: scripts/tag_audit.py

What it does and when to use it

Measure a site accurately, lawfully and lightly: analytics, tags, events, conversions and consent. Use when setting up GA4 with Google Tag Manager or Consent Mode v2, choosing a privacy-first tool (Plausible, Umami, Matomo, PostHog, Cloudflare), designing an event and conversion taxonomy with UTM and cross-domain rules, filtering bot and internal traffic, planning a consent banner and cookie inventory for GDPR, UK PECR, India DPDP, California CPRA or Global Privacy Control, or joining Search Console and Bing data. Audits the delivered HTML for trackers that fire before consent. Triggers on GA4

Original author description

Measure a site accurately, lawfully and lightly: analytics, tags, events, conversions and consent. Use when setting up GA4 with Google Tag Manager or Consent Mode v2, choosing a privacy-first tool (Plausible, Umami, Matomo, PostHog, Cloudflare), designing an event and conversion taxonomy with UTM and cross-domain rules, filtering bot and internal traffic, planning a consent banner and cookie inventory for GDPR, UK PECR, India DPDP, California CPRA or Global Privacy Control, or joining Search Console and Bing data. Audits the delivered HTML for trackers that fire before consent. Triggers on GA4

How it works

  1. When to use and when to stay off
  2. Non-negotiables
  3. Procedure
  4. Self-audit
  5. What this cannot do
Original SKILL.md headings · 141 lines, 2,713 words
SKILL.md preview
---
name: web-analytics
description: "Measure a site accurately, lawfully and lightly: analytics, tags, events, conversions and consent. Use when setting up GA4 with Google Tag Manager or Consent Mode v2, choosing a privacy-first tool (Plausible, Umami, Matomo, PostHog, Cloudflare), designing an event and conversion taxonomy with UTM and cross-domain rules, filtering bot and internal traffic, planning a consent banner and cookie inventory for GDPR, UK PECR, India DPDP, California CPRA or Global Privacy Control, or joining Search Console and Bing data. Audits the delivered HTML for trackers that fire before consent. Triggers on GA4 setup, Google Tag Manager, consent mode, cookie banner, tracking plan, event taxonomy, conversion tracking, UTM, Plausible, Matomo, PostHog, GDPR cookies, DPDP, Global Privacy Control. For ranking use seo-audit, seo-content and seo-technical. For a local business use local-seo. For the build plan use website-build. For CSP use security-hardening. For load cost use performance-tuning. For JSON-LD use structured-data."
license: MIT
metadata:
  version: 1.0.2
  suite: ai-skill
---

# Web analytics and consent

The common failure is a tracking setup that is wrong in one of three ways at once: it loads a tag before the visitor agreed, so it breaks the law; it fires events with names nobody wrote down, so the data means nothing a month later; and it ships three analytics libraries where one would do, so the page is slow. None of these show up in a browser, because the browser renders the page and the tags fire regardless. They show up later as a regulator letter, a dashboard nobody trusts, and a slow first paint. This skill builds measurement that is accurate, lawful and light, decides consent and event design before a tag is added, and audits the delivered HTML with a script instead of trusting the tag manager preview.

## When to use and when to stay off

Run when the task decides what is measured, how a tag loads, or whether it may fire: a GA4 or privacy-first setup, an event and conversion plan, UTM and cross-domain rules, bot and internal-traffic filtering, data retention, a consent banner and cookie inventory, a tag-weight budget, or a reporting dashboard that joins search and analytics data.

Stay off, and route instead, when:

- The question is search ranking, keywords or on-page copy. Use `seo-content`. For an existing-site crawl and issue catalogue use `seo-audit`. For rendering, canonicals and robots at build time use `seo-technical`.
- The work is a Google Business Profile or map-pack presence for a local business. Use `local-seo`; hand it back the measurement plan.
- The task is the whole site delivery from goals to launch. Use `website-build`; this skill owns its analytics and consent step.
- The work is the Content Security Policy, the tag-domain allowlist or payload inspection for personal data. Use `security-hardening`.
- The problem is how much the tags cost to load and when. Use `performance-tuning`.
- The work is JSON-LD or rich-result markup. Use `structured-data`.
- The work is personal data beyond consent for tracking: the inventory, retention, deletion or rights requests. Use `privacy-engineering`.
- The question is what the collected numbers mean: cohorts, funnels, or why two reports disagree. Use `data-analysis`; this skill owns collection.

Where a consent banner has to be operable by keyboard and screen reader, use `accessibility`.

The user says "stop", "I've decided", or "just execute": comply at once and stay off for the rest of the session unless asked again.

## Non-negotiables

These override everything else in this file.

1. No non-essential tag fires before consent. A tag that sets non-essential cookies or profiles a user in the EEA or UK must not load or send until the visitor has agreed. Confirm it against the delivered HTML with `scripts/tag_audit.py`, not against the tag manager preview, which runs in your own already-consented session.
2. Reject must be as easy as accept, and nothing is pre-ticked. A consent banner with an "Accept all" button and no equally prominent "Reject all" at the same level, or a toggle defaulted to on, is not valid consent under GDPR or ePrivacy. State this as a build requirement, not advice.
3. No secret reaches the client. A GA4 measurement id (`G-...`) and a GTM container id (`GTM-...`) are public by design and belong client-side. An API secret, a private key or a server token must never be pasted into a tag or inline script; `tag_audit.py` flags inline-secret matches and that finding blocks the release.
4. Every event name is written down before it ships. An event fired with an ad-hoc name and no documented parameters is unrecoverable data. The naming taxonomy and required parameters exist as a tracking plan the tags are built from, in one place, before the tag is added.
5. Every time-sensitive fact carries its date and source, or an `ASSUMPTION:` label with its risk. Consent law, Consent Mode requirements, tool licences and retention defaults change; a flat assertion of a legal deadline or a licence is a liability.
6. A lawyer confirms the consent setup for a regulated business. This skill names the rules and dates and builds the banner behaviour; it does not give legal advice. For a site in a regulated field or one serving a jurisdiction you have not checked, the question in What this cannot do goes to a qualified lawyer.

## Procedure

### Step 1, decide what to measure before choosing a tool

Write the handful of outcomes the site exists to produce (a sale, a signup, a contact, a qualified lead), then the events and the one or two parameters each needs. This is the tracking plan. It is the input to every later step, and it is what keeps a dashboard readable: a metric nobody named in step 1 does not get a tag.

Name events in one taxonomy and keep to it. GA4 reserves some names (`page_view`, `session_start`, `purchase` and the other recommended events), so use the recommended name where one fits and a consistent `snake_case` verb_noun (`form_submit`, `cta_click`, `file_download`) where none does. Record each event with its required parameters, whether it is a key event (GA4's term for what used to be a conversion, renamed in 2024, verified October 2026), and which step 1 outcome it serves.

### Step 2, choose a measurement tool against consent weight and licence

Pick the lightest tool that answers the step 1 questions. The trade is consent burden and page weight against depth of data.

- GA4 with Google Tag Manager: deepest free option, but it profiles users, so it needs prior consent in the EEA and UK and a Consent Mode setup (step 4). GTM is the container; GA4 is the tag inside it.
- Privacy-first, cookieless, usually no consent banner needed because no non-essential cookie is set (confirm per jurisdiction):
  - Plausible Community Edition, self-hosted, AGPL-3.0 (plausible.io, verified October 2026). Needs ClickHouse plus PostgreSQL, so it is heavier to run than it looks.
  - Umami, self-hosted, MIT (github.com/umami-software/umami, verified October 2026). Light; needs PostgreSQL or MySQL.
  - Matomo, self-hosted, GPLv3 (matomo.org, verified October 2026). Can run cookieless or with cookies; the cookie mode needs consent. Needs PHP and MySQL or MariaDB.
  - PostHog, self-hosted open-source edition, MIT (github.com/PostHog/posthog, verified October 2026). Product analytics, session replay and feature flags in one; the heaviest to self-host, and session replay records user behaviour, so treat it as consent-requiring.
  - Cloudflare Web Analytics: hosted, free, cookieless, not self-hostable and not open source (proprietary; cloudflare.com, verified October 2026). Lightest to adopt if the site is already on Cloudflare.
- Self-hosting any of the above means you run the database, the backups, the upgrades and the uptime. That is the cost that buys the privacy posture; name it, do not hide it.

Keep measurement ids out of code review of secrets: a `G-` or `GTM-` id in a diff is not a leak, so do not let a secret scanner's noise train reviewers to wave through the real thing. Server-side tagging (a GTM server container on your own domain) moves tag delivery server-side, which trims client weight and keeps some data from going straight to third parties, at the cost of running the container; reach for it when client tag weight or data-sharing is the constraint, not by default.

### Step 3, lay out events, UTM and cross-domain rules

Build the tags from the step 1 plan, not the other way round. Set conversions or key events only on the outcomes that matter, so the dashboard is not a wall of equal-looking numbers.

UTM convention: fix `utm_source`, `utm_medium` and `utm_campaign` to a documented vocabulary (lowercase, no spaces, a short agreed set of mediums such as `email`, `cpc`, `social`) so the same campaign is not split across `Email`, `email` and `e-mail`. Keep the convention in the tracking plan.

Cross-domain and subdomain: a visitor moving between two domains you own needs linker configuration or the session splits into two; a subdomain usually shares the cookie already. Decide which hosts are one property before launch.

### Step 4, set consent and Consent Mode before the tag loads

For a Google setup serving the EEA, UK or Switzerland, Consent Mode v2 is required for ads personalization, remarketing and measurement features (Google, required since March 2024, verified October 2026). Set a denied-by-default consent state, then update it from the banner:

```html
<!-- before any Google tag loads -->
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('consent', 'default', {
    ad_storage: 'denied', ad_user_data: 'denied',
    ad_personalization: 'denied', analytics_storage: 'denied'
  });
</script>
```

Basic versus advanced (Google, verified October 2026): basic blocks the Google tags entirely until consent, so no ping is sent before a choice; advanced loads the tags in a cookieless state that sends a limited signal and models the rest, giving more data at the cost of sending something before consent. Basic is the stricter default; advanced is a business choice that a lawyer and the data owner make together, not one you make for them.

Build the banner to non-negotiable 2: equally prominent accept and reject at the first layer, no pre-ticked toggles, a visible way to change the choice later, and the banner operable by keyboard and screen reader (use `accessibility` for that audit). Keep a cookie inventory: every cookie and storage key, its purpose, whether it is essential, and its lifetime. Tags stay blocked until the matching consent is granted.

### Step 5, apply the law for each jurisdiction the site serves

Name the regime, do not generalise. All dates verified October 2026.

- EU GDPR and the ePrivacy Directive: non-essential cookies and similar storage need prior, informed, freely given consent before they are set. GDPR governs the personal data the analytics then processes.
- UK PECR, as amended by the Data (Use and Access) Act 2025: the DUAA received Royal Assent on 19 June 2025; the cookie changes to PECR came into force on 5 February 2026, and the ICO updated its cookie guidance on 29 April 2026. The change adds narrow exceptions for low-risk, non-intrusive storage (including some analytics), but confirm a given use qualifies before relying on the exception rather than assuming all analytics is now exempt.
- India DPDP Act 2023 with the DPDP Rules 2025: the Rules were notified on 13 November 2025 and commence in phases. Rules 1, 2 and 17 to 21 took effect on 13 November 2025; Rule 4 (Consent Manager registration) takes effect on 14 November 2026; the substantive core (Rules 3, 5 to 16, 22 and 23, including the consent-notice and data-fiduciary duties) takes effect on 14 May 2027. Consent must be free, specific, informed, unconditional and unambiguous, and the data fiduciary must be able to prove notice was given and consent obtained.
- California CPRA (amending the CCPA): businesses must honour an opt-out preference signal, including Global Privacy Control, as a request to opt out of the sale or sharing of personal information; as of 1 January 2026 a business must also give the consumer a way to confirm the opt-out was processed (California Privacy Protection Agency, verified October 2026).
- Global Privacy Control: a browser-level signal that automates the opt-out. Honour it server-side and in the tag layer, not just in the banner, because it arrives on the request, not through a click.

Mark any jurisdiction you were not asked about and did not check as `ASSUMPTION: not reviewed for <place>` rather than implying the setup is lawful everywhere.

### Step 6, filter bots and internal traffic, set retention

Exclude internal and developer traffic (by IP range, a cookie or a dedicated environment) so staff activity does not inflate the numbers. Keep GA4's known-bot filtering on; it drops traffic from the IAB and Google known-bot lists but not every scraper, so expect some residue. Set data retention to the shortest period that answers the step 1 questions (GA4's event-data retention defaults to a short window and is a setting, not a given); a longer retention is a data-protection choice to justify, not a default to leave.

### Step 7, budget tag weight and hand off security and performance

Set a tag-weight budget as a number: how many kilobytes of third-party script the page may load and how it loads (deferred, after consent, never render-blocking). Each tag added is checked against it. Hand the Content Security Policy and the allowlist of tag domains to `security-hardening`, and the load-timing and render-blocking analysis to `performance-tuning`; this skill decides which tags exist and when they may fire, those skills decide how they are allowed and how fast they load.

### Step 8, build a report owners read

Join search data with analytics so the dashboard answers a real question. Search Console gives queries, impressions and clicks from Google; Bing Webmaster Tools gives the same from Bing; analytics gives what the visitor did after the click. A dashboard (Looker Studio or the tool's own) that puts acquisition next to the step 1 outcomes is one an owner reads; a dump of every metric is one they ignore. Build to the step 1 outcomes, not to what the tool can display.

### Step 9, audit the delivered HTML

Run the tag audit against the real response before calling the work done:

```
py -3 scripts\tag_audit.py https://example.com --fetch
py -3 scripts\tag_audit.py built-page.html --strict --json
```

It reads the raw server HTML and reports recognised vendors by domain and consent class, a consent-requiring tag that loads with no consent manager ahead of it (high), a Google tag with no `gtag('consent','default',...)` (medium), duplicate GA4 or GTM ids (medium), and a secret-looking value in inline script (high). Exit 0 clean, 1 at or above the fail threshold (high by default, medium with `--strict`), 2 on a read or fetch error. Fix the high findings, record the run and its date, and read the limit below before trusting a clean result.

## Self-audit

- Every "no tag before consent" claim quotes a `tag_audit.py` run against the delivered HTML, with its date, not the tag manager preview.
- The consent banner offers reject as prominently as accept at the first layer, with no pre-ticked toggles.
- No API secret, private key or server token appears in any tag or inline script; `tag_audit.py` reports no inline-secret finding.
- Every event has a documented name and required parameters in one tracking plan, and conversions or key events are set only on step 1 outcomes.
- A Google setup serving the EEA, UK or Switzerland sets a denied-by-default Consent Mode state before any Google tag loads.
- Every legal deadline, Consent Mode requirement and tool licence carries its date and source, and any unchecked jurisdiction is labelled `ASSUMPTION:`.
- Internal and bot traffic is filtered, and data retention is set to a justified period rather than left at a default.
- A tag-weight budget exists as a number, and CSP and load-timing are routed to `security-hardening` and `performance-tuning`.
- The reporting dashboard joins search and analytics data against the step 1 outcomes.

## What this cannot do

It cannot see tags that a consent manager injects only after a click. `tag_audit.py` reads the raw server response and never runs JavaScript, so a tracker loaded by a tag manager after the visitor interacts is invisible to it. It catches the common failure (a tag hard-coded into the delivered HTML with no consent gate), not a misconfigured post-consent injection; confirm the post-consent path by watching network requests in the browser with consent denied.

It cannot give legal advice or certify compliance. It names the regimes, their dates and the banner behaviour they require, and builds to them, but whether a specific setup is lawful for a specific business in a specific place is a legal judgement. For a regulated business, or any jurisdiction not checked here, ask a lawyer qualified in data protection in that country: "Given these cookies and this consent flow, does our setup meet consent, notice and retention duties under the law that applies to our users, and are any of our analytics uses exempt?"

It cannot prove a tag is accurate. The audit confirms which tags load and when; it does not confirm an event fires with the right parameters or that a conversion maps to a real outcome. That needs a test that triggers the event and reads it in the tool's debug view, which the user runs.
Files in this package (2)
  • SKILL.md 17 KB
  • scripts/tag_audit.py 16 KB

Versions

RepositoryScoreLicence
This page · devpilotX/ai-skill-ai98MIT
jeremylongshore/tons-of-skills-marketplace100MIT

Database snapshot: 13.11.2026 · package version 4698f74c47cb (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 95analytics
    Privacy-first analytics knowledge base - Plausible, PostHog, Umami, Vercel Analytics, cookie consent. Use when setting up analytics, tracking events, measuring conversions, or integrating analytics tools.
  • 90analytics
    Set up and read analytics for sites and apps: tracking plans, GA4 and GTM, Plausible, PostHog, Mixpanel, Firebase, consent and privacy (DPDP, GDPR), UTMs, conversion goals, event QA, dashboards, funnels, retention, A/B results. Use when asked to track, measure, add analytics,…
  • 100api-analytics-posthog-analytics
    PostHog event tracking, user identification, group analytics for B2B, GDPR consent patterns. Use when implementing product analytics, tracking user behavior, setting up funnels, or configuring privacy-compliant tracking.
  • 100iubenda
    Iubenda integration for cookie consent, privacy policy, and GDPR compliance. Use when integrating Iubenda cookie banner, setting up Google Consent Mode v2, or generating privacy documents with Iubenda.
  • 90google-analytics-4
    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…
  • 100cookie-consent
    Implement GDPR and ePrivacy-compliant cookie consent: a banner with equal Accept and Reject buttons, per-category choices, stored consent records, consent-gated analytics with Google Consent Mode v2, and Global Privacy Control. Use when adding a cookie banner, managing marketing…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.