consent-management

consent-management is a skill for Claude Code, Codex, Cursor from kws-projects/react-boilerplate. It costs 0 tokens per session (1,317 once invoked), scanned A, original, MIT.

A guide for changing Google Analytics 4 consent handling, including the setting that controls whether analytics and advertising storage start allowed or denied. It also covers connecting a consent-management platform, which collects visitors' choices.

In plain words
What is it for?
Use it when launching a site in a consent-required market, adding a consent-management platform, or changing the site's default tracking permission. It also helps update the analytics setup to reflect an organisation's privacy policy.
Why use it?
It helps adapt analytics tracking to privacy requirements in places such as the European Union, the United Kingdom, or Brazil. It makes the required change from automatic permission to prior user choice explicit.

Skill for Claude CodeCodexCursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/kws-projects/react-boilerplate/consent-management
Any agent
npx skills add kws-projects/react-boilerplate --skill consent-management
Clone the repo
git clone --depth 1 https://github.com/kws-projects/react-boilerplate

Made for: Claude Code, Codex, Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for consent-management

README.md
[![agentmods](https://agentmods.dev/badge/skills/kws-projects/react-boilerplate/consent-management.svg)](https://agentmods.dev/skills/kws-projects/react-boilerplate/consent-management)
Your own site
<a href="https://agentmods.dev/skills/kws-projects/react-boilerplate/consent-management"><img src="https://agentmods.dev/badge/skills/kws-projects/react-boilerplate/consent-management.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,317 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01317
Opus 5 $0.00000 $0.00659
Sonnet 5 $0.00000 $0.00263
Haiku 4.5 $0.00000 $0.00132

Measured 4d ago against content hash 27e0bdcadc9e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

consent-management scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/skills/consent-management/SKILL.md · 173 lines

How it starts

The opening of the file, as written. The whole thing — 173 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Integrate or modify consent handling for GA4 Consent Mode v2. Use when launching in a consent-required market (EU/EEA, UK, Brazil LGPD, etc.), integrating a Consent Management Platform (CMP), or modifying the default consent posture.

Current state

Consent defaults to granted in src/lib/analytics.ts. No CMP is integrated. This is appropriate when the target market has no legal requirement for prior user consent before analytics tracking.

When to change

You must switch to a consent-denied default when any of these apply:

  • Launching in the EU/EEA or UK (GDPR / ePrivacy Directive)
  • Launching in Brazil (LGPD)
  • Launching in a jurisdiction with similar consent-before-tracking laws
  • Your organisation's privacy policy requires opt-in consent regardless of market

Step 1: Change the default consent posture

In src/lib/analytics.ts, inside init(), replace the granted defaults:

// Before (current — consent granted by default)
gtag('consent', 'default', {
  analytics_storage: 'granted',
  ad_storage: 'granted',
  ad_user_data: 'granted',
  ad_personalization: 'granted',
})

// After (consent denied until user grants)
gtag('consent', 'default', {
  analytics_storage: 'denied',
  ad_storage: 'denied',
  ad_user_data: 'denied',
  ad_personalization: 'denied',
  wait_for_update: 500, // ms to wait for CMP to load
})

Step 2: Integrate a CMP

Choose one of the following approaches:

Option A: Third-party CMP (recommended for production)

Popular CMPs with Google Consent Mode v2 support:

  • Cookiebot — automatic geo-detection, plug-and-play script tag
  • OneTrust — enterprise-grade, geo-specific banner rules
  • Usercentrics — strong EU compliance, Google CMP partner
  • Cookie Information — simple setup, Google-certified

These CMPs automatically call gtag('consent', 'update', {...}) when the user interacts with the banner. No custom code needed beyond loading their script.

Read the full file on GitHub · 173 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 173 lines · 0 tokens per session scan A 27e0bdcadc9e

Subscribe to this mod's changes

consent-management is a skill published in the GitHub repository kws-projects/react-boilerplate (3 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,317 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

check-code-attribution

Per-file check of vendored code attribution in the current branch diff, including license headers, THIRDPARTYNOTICES.md entries, and compatibility with Sentry's licensing policy.

getsentry/sentry-java · 39 tokens

i18n-date-patterns

Implements internationalization (i18n) in React applications. Covers user-facing strings, date/time handling, locale-aware formatting, ICU MessageFormat, and RTL support. Use when building multilingual UIs or formatting dates/currency.

yonatangross/orchestkit · 53 tokens

anvil-adsense-audit

AdSense 申请前全站体检——按 Google 官方政策(计划政策/发布商政策/内容质量/抓取可达/隐私合规)逐项审计站点是否达到申请标准,模板已解决的项直接给证据,fork 用户侧的项逐项判定,输出 Pass/Fail/Unknown/N/A 完整表格 + Blocker/High/Medium 分级裁决。触发词:adsense 审计 / 能不能申请 adsense / 被拒了帮我看下 / 申请前自查 / adsense audit / 过审。.

PNGTRID/AnvilWiki · 136 tokens

full-after-care

Tiefe Pflegerunde für ein veröffentlichtes GitHub-Repository (Stufe 2): enthält den vollständigen surface-after-care-Durchlauf und ergänzt ihn um drei teure Schritte — rechtliche Ersteinschätzung über die Law-Checker mit Wiedervorlage nach einem Jahr (Gutachten bleibt gitignored im Repo), Querverweise zu verwandten…

ellmos-ai/skills · 196 tokens

i18n

Flutter 국제화(i18n) 가이드라인. flutterlocalizations, intl, ARB 파일 관리, RTL 레이아웃, 복수형/성별 처리, 런타임 로캘 전환.

sonature-lab/timsquad · 50 tokens

Risk Factor Review

Use when reviewing the risk-factor section of an S-1, 10-K, 10-Q, S-4, proxy, PPM, or OM to produce a draft specificity-vs-boilerplate matrix, consistency notes, and category-coverage gaps for attorney review, without concluding adequacy of disclosure.

zgbrenner/agentcounsel · 67 tokens