indranilbanerjee/digital-marketing-pro / skills/analytics-insights
analytics-insights
VerifiedDesign the analytics layer with script-backed benchmarks: KPI trees, report templates, MMM, cookieless. "define our KPIs"
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 26.1 KB |
| anomaly-diagnosis.md | markdown | 13.7 KB |
| clv-analysis.md | markdown | 15.7 KB |
| competitive-intelligence.md | markdown | 13.5 KB |
| dark-social-tracking.md | markdown | 13.4 KB |
| dashboard-design.md | markdown | 20.9 KB |
| incrementality-testing.md | markdown | 14.2 KB |
| kpi-frameworks.md | markdown | 11.7 KB |
| mmm-framework.md | markdown | 17.6 KB |
| privacy-first-measurement.md | markdown | 19.2 KB |
| reporting-templates.md | markdown | 11.0 KB |
privacy-first-measurement.md
View on GitHub# Privacy-First Measurement — Cookieless Attribution
> **Script location.** If your host does not set `${CLAUDE_PLUGIN_ROOT}`, the scripts are in this plugin's `scripts/` folder, next to `skills/`. Run them with Python 3.10 or newer: `python`, or `python3` where `python` is not found (macOS, many Linux systems).
> **Benchmark provenance (as of 2026-08):** Dollar figures in this document are planning priors, not quotes — market and auction rates drift continuously. Before any figure enters a media plan, budget, or client deliverable, refresh it live (platform dashboards and current published reports beat memory) and record it with `python "${CLAUDE_PLUGIN_ROOT}/scripts/benchmark_book.py" --action record ... --source <url>`; quote from the book thereafter (`--action quote`). Never present an unstamped figure as current market fact.
## The Privacy Landscape
The era of unrestricted cross-site tracking is over. Safari and Firefox have blocked third-party cookies since 2020. Chrome kept third-party cookies and retired most Privacy Sandbox APIs on 2025-10-17, so cross-site measurement rests on consent, first-party data, and modeled conversions rather than a browser replacement. Regulations like GDPR, CCPA/CPRA, and emerging state and international laws require explicit consent for tracking. Marketers who do not adapt their measurement infrastructure will lose sight of a growing share of their customer journey.
### What Has Changed
| Change | Impact on Measurement | Timeline |
|--------|----------------------|----------|
| Safari ITP (Intelligent Tracking Prevention) | First-party cookies capped at 7 days (24 hours for some); cross-site tracking blocked | Active since 2020 |
| Firefox Enhanced Tracking Protection | Third-party cookies blocked by default | Active since 2019 |
| Chrome Privacy Sandbox | Chrome keeps third-party cookies, with the user's choice in settings. Timeline: July 2024, Google dropped the deprecation plan; April 2025, no standalone cookie prompt; 2025-10-17, Google retired Attribution Reporting, IP Protection, On-Device Personalization, Private Aggregation (with Shared Storage), Protected Audience, Protected App Signals, Related Website Sets, SelectURL, SDK Runtime and Topics. Continuing: CHIPS, FedCM, Private State Tokens, and work on an interoperable attribution standard at the W3C. Do not build measurement on the retired APIs | [privacysandbox.google.com](https://privacysandbox.google.com/blog/update-on-plans-for-privacy-sandbox-technologies) (2025-10-17, read 2026-10-28) |
| iOS App Tracking Transparency (ATT) | Users must opt-in to cross-app tracking; ~25% opt-in rate | Active since iOS 14.5 (2021) |
| GDPR (EU) | Requires explicit consent for non-essential cookies; fines up to 4% of global revenue | Active since 2018 |
| CCPA/CPRA (California) | Right to opt-out of sale/sharing of personal data | Active since 2020/2023 |
| State privacy laws (US) | Virginia, Colorado, Connecticut, Texas, Oregon, and more with similar requirements | 2023-2026 rolling |
| ePrivacy Regulation (EU — WITHDRAWN Feb 2025) | Proposal withdrawn from the Commission work programme; the 2002 ePrivacy Directive cookie rules remain in force | Watch the Digital Fairness Act workstream |
---
## Cookieless Attribution Approaches
### The New Measurement Stack
The replacement for cookie-based attribution is not a single solution but a combination of approaches.
| Approach | What It Does | Privacy Level | Accuracy | Implementation Effort |
|----------|-------------|---------------|----------|----------------------|
| **Server-side tracking** | Sends conversion data from your server to ad platforms (bypasses browser restrictions) | Medium (still processes user data) | High | Medium-High |
| **First-party data matching** | Matches your CRM/email data to platform users via hashed identifiers | Medium | Medium-High | Medium |
| **Consent-based tracking** | Full tracking for users who consent; modeled data for those who do not | High | Medium (depends on consent rate) | Medium |
| **Marketing Mix Modeling** | Aggregate statistical analysis requiring no user data | Very High | Medium (strategic, not tactical) | High |
| **Incrementality testing** | Controlled experiments measuring causal lift | Very High | High (for tested channels) | High |
| **Privacy Sandbox APIs** | Chrome's Topics, Attribution Reporting, Protected Audience — retired 2025-10-17 | Low (retired) | High (sunk cost) | Do not adopt; migrate existing use to server-side conversions + modeled measurement |
| **Data clean rooms** | Secure environments for matching advertiser + publisher data without exposing PII | High | Medium-High | High |
| **Self-reported attribution** | Asking users directly how they found you | Very High | Low-Medium (recall bias) | Low |
---
## Consent Management Architecture
### Consent Management Platform (CMP) Requirements
A CMP is the foundation of privacy-compliant measurement. It must handle:
| Requirement | Detail |
|-------------|--------|
| **Consent collection** | Display a compliant banner on first visit; collect granular consent by purpose |
| **Consent storage** | Store consent state server-side (not just in a cookie that expires) |
| **Consent propagation** | Pass consent signals to all tags, pixels, and server-side integrations |
| **Consent withdrawal** | Allow users to change preferences at any time via a persistent link |
| **Geo-based rules** | Apply GDPR rules to EU visitors, CCPA to California, etc. |
| **TCF 2.3 compliance** | Support the IAB Transparency & Consent Framework v2.3 for programmatic: the move from 2.2 ended 2026-02-28, and IAB Europe's CMP policy deadlines are mid-October 2026 (web) and mid-February 2027 (apps) (IAB Europe letter, 2026-05-29) |
| **Google Consent Mode v2** | Required by Google's EU user consent policy for ad personalization and measurement of users in the EEA, the UK and Switzerland. It sends four consent signals to Google tags (table below) |
### CMP Tool Options
| Tool | Best For | Pricing |
|------|----------|---------|
| Cookiebot (Usercentrics) | SMB to mid-market, easy setup | Free (< 100 pages), paid from ~$15/mo |
| OneTrust | Enterprise, complex multi-geo requirements | Custom pricing |
| Osano | Mid-market, good UX | From ~$199/mo |
| TrustArc | Enterprise, regulatory compliance focus | Custom pricing |
| Sourcepoint | Publishers and ad-tech focused | Custom pricing |
### Consent Mode Implementation
Google Consent Mode v2 allows your tags to adjust behavior based on user consent:
| Consent State | Tag Behavior | Data Collected |
|--------------|-------------|----------------|
| `ad_storage = granted` | Full ad tracking, remarketing | Cookies, click IDs, conversion data |
| `ad_storage = denied` | Cookieless pings for conversion modeling | Aggregated, modeled conversions |
| `analytics_storage = granted` | Full GA4 tracking | User-level analytics data |
| `analytics_storage = denied` | Cookieless pings for analytics modeling | Modeled, aggregated analytics |
| `ad_user_data = granted` | User data may be sent to Google for advertising | Needed for enhanced conversions and tag-based conversion tracking |
| `ad_user_data = denied` | No user data sent for advertising | Enhanced conversions and tag-based conversion tracking get no data |
| `ad_personalization = granted` | Data may be used for personalized ads | Remarketing audiences |
| `ad_personalization = denied` | No personalized advertising | Remarketing in Google Ads, DV360 and SA360 receives no data |
Both `ad_user_data` and `ad_personalization` must be granted for personalized advertising (Google Ads consent mode reference, support.google.com/google-ads/answer/13802165, undated, read 2026-10-27).
**Implementation checklist:**
- [ ] CMP installed and configured for all applicable jurisdictions
- [ ] Google Consent Mode v2 integrated with CMP
- [ ] Default consent state set correctly by region (denied for EEA, granted for US unless opted out)
- [ ] All Google tags (GA4, Ads, Floodlight) updated to respect consent signals
- [ ] Meta Pixel configured to respect consent (via CMP integration or Meta Consent Mode)
- [ ] Consent rates monitored and optimized (target > 70% opt-in with compliant UX)
- [ ] Server-side backup measurement active for non-consented users
---
## Server-Side Tracking Implementation
### Meta Conversions API (CAPI)
CAPI sends conversion events from your server directly to Meta, bypassing browser-based pixel limitations.
**Architecture:**
```
User converts on your site
→ Your server captures event data
→ Your server sends event to Meta CAPI endpoint
→ Meta matches the event to the user via hashed identifiers
→ Meta uses the event for optimization and reporting
```
**Implementation options:**
| Method | Complexity | Best For |
|--------|-----------|----------|
| **Shopify native integration** | Low | Shopify merchants (toggle on in settings) |
| **GTM Server-Side** | Medium | Teams using Google Tag Manager |
| **Direct API integration** | High | Custom platforms, maximum control |
| **Partner integration (Segment, mParticle)** | Medium | Teams using a CDP |
**Data to send via CAPI:**
| Parameter | Required? | Purpose |
|-----------|----------|---------|
| `event_name` | Yes | Purchase, AddToCart, Lead, etc. |
| `event_time` | Yes | Unix timestamp of the event |
| `action_source` | Yes | `website`, `app`, `email`, etc. |
| `user_data.em` | Strongly recommended | Hashed email for matching |
| `user_data.ph` | Recommended | Hashed phone for matching |
| `user_data.fn` / `user_data.ln` | Recommended | Hashed first/last name |
| `user_data.external_id` | Recommended | Your internal user ID (hashed) |
| `user_data.fbc` | If available | Facebook click ID from URL parameter |
| `user_data.fbp` | If available | Facebook browser ID from _fbp cookie |
| `custom_data.value` | For purchase events | Transaction revenue |
| `custom_data.currency` | For purchase events | Currency code (USD, EUR) |
**Deduplication:** If you run both the browser pixel and CAPI, you must include an `event_id` in both to prevent double-counting. Use the same unique ID (e.g., order ID) in both the pixel event and the CAPI event.
### Google Enhanced Conversions
Enhanced Conversions sends hashed first-party data (email, phone, address) with your Google Ads conversion tags, improving match rates.
**Types:**
| Type | How It Works | Best For |
|------|-------------|----------|
| **Enhanced Conversions for Web** | Hashed user data sent with the gtag conversion event | Lead gen, eCommerce with on-site purchases |
| **Enhanced Conversions for Leads** | Upload offline conversion data matched via hashed identifiers | B2B with offline sales cycle |
**Implementation checklist:**
- [ ] Accept Google Ads Enhanced Conversions terms
- [ ] Identify where user data is captured (checkout, lead form, account creation)
- [ ] Configure gtag.js or GTM to capture and hash user data fields (email, phone, name, address)
- [ ] Verify Enhanced Conversions in Google Ads diagnostics (check match rate — target > 60%)
- [ ] For leads: Set up offline conversion import with GCLID or hashed email matching
- [ ] Test with Google Tag Assistant to confirm hashed data is sending correctly
### TikTok Events API
| Element | Detail |
|---------|--------|
| **Endpoint** | TikTok Events API (server-to-server) |
| **Matching** | Hashed email, phone, or TikTok click ID (ttclid) |
| **Key events** | ViewContent, AddToCart, CompletePayment, SubmitForm |
| **Deduplication** | Use `event_id` matching between pixel and Events API |
| **Setup** | Via TikTok Business Center or partner integration |
---
## First-Party Data Strategy
### Building a First-Party Data Foundation
| Data Source | What to Capture | Storage | Use Case |
|-------------|----------------|---------|----------|
| Email signups | Email, name, acquisition source | CRM / CDP | Server-side matching, email marketing, lookalike audiences |
| Purchases | Email, phone, address, purchase history | eCommerce platform + CRM | CAPI matching, segmentation, LTV modeling |
| Account creation | Email, profile data, preferences | Auth system + CRM | Personalization, cross-device matching |
| Loyalty program | Email, phone, purchase frequency, preferences | Loyalty platform + CRM | High-match-rate audiences, retention measurement |
| Quizzes / surveys | Email, preferences, intent signals | CRM / CDP | Segmentation, personalized retargeting |
| On-site behavior | Page views, search queries, clicks (with consent) | Analytics + CDP | Behavioral audiences, content optimization |
### First-Party Audience Activation
| Platform | Audience Feature | Match Method | Typical Match Rate |
|----------|-----------------|-------------|-------------------|
| Meta | Custom Audiences | Hashed email, phone | 60-80% |
| Google | Customer Match | Hashed email, phone, address | 50-70% |
| TikTok | Custom Audiences | Hashed email, phone | 40-60% |
| LinkedIn | Matched Audiences | Hashed email, company name | 30-50% |
| Pinterest | Customer Lists | Hashed email | 40-60% |
**Match rate optimization:**
- Include as many identifiers as possible (email + phone + name + address)
- Clean and standardize data before upload (lowercase, trim whitespace, consistent formatting)
- Update lists regularly (weekly or automated sync via CDP)
- Use double opt-in email to ensure valid addresses
- Enrich data with phone number capture at checkout
---
## Data Clean Rooms
### What Are Data Clean Rooms?
A data clean room is a secure, privacy-preserving environment where two or more parties can match and analyze their data without either party seeing the other's raw data.
| Provider | Type | Best For |
|----------|------|----------|
| **Google Ads Data Hub** | Platform-specific | Analyzing Google Ads performance with your first-party data |
| **Meta Advanced Analytics** | Platform-specific | Cross-referencing Meta ad exposure with your conversion data |
| **AWS Clean Rooms** | Cloud-based (neutral) | Multi-party data collaboration (retailer + brand, publisher + advertiser) |
| **Snowflake Data Clean Rooms** | Cloud-based (neutral) | Enterprise data collaboration with existing Snowflake infrastructure |
| **LiveRamp Data Collaboration** | Identity-based | Cross-platform audience matching and measurement |
| **InfoSum** | Decentralized | Privacy-first collaboration without data movement |
### Use Cases
| Use Case | How It Works | Privacy Benefit |
|----------|-------------|-----------------|
| **Cross-platform measurement** | Match your conversion data with ad platform exposure data | No raw data leaves either party's environment |
| **Retail media attribution** | Brand matches sales data with retailer's ad exposure data | Brand does not see retailer's customer data and vice versa |
| **Publisher audience insight** | Advertiser learns about overlap between their customers and a publisher's audience | No PII exchanged |
| **Multi-touch analysis** | Combine exposure data from multiple platforms in one clean room | Platforms do not see each other's data |
---
## Privacy-Preserving Reporting
### Aggregated Reporting Standards
| Principle | Implementation |
|-----------|---------------|
| **Minimum aggregation thresholds** | Never report on segments with fewer than 50 users (some platforms require 100+) |
| **Differential privacy** | Add statistical noise to small segments to prevent individual identification |
| **Cohort-level reporting** | Report on user groups (cohorts), not individuals |
| **Time-delayed reporting** | Accept 24-72 hour data delays in exchange for privacy compliance |
| **Modeled conversions** | Use platform-modeled data to fill gaps from non-consented users |
### GA4 Privacy Configuration
- [ ] Data retention set to appropriate period (14 months max, or shorter per policy)
- [ ] IP anonymization confirmed (default in GA4)
- [ ] Google Signals enabled only if consent is collected
- [ ] User-ID tracking implemented only with consent
- [ ] Data deletion requests automated via API
- [ ] Consent Mode v2 active and verified
- [ ] Thresholding understood (GA4 hides rows when sample size is too small)
- [ ] BigQuery export configured for raw data analysis (where consent supports it)
---
## Privacy Regulation Compliance for Measurement
### Compliance Checklist by Regulation
| Requirement | GDPR | CCPA/CPRA | Other US State Laws |
|-------------|------|-----------|-------------------|
| Consent required before tracking? | Yes (opt-in) | No (opt-out model) | Varies (mostly opt-out) |
| Must disclose data collection? | Yes (privacy policy) | Yes (privacy policy) | Yes |
| Right to deletion? | Yes | Yes | Yes (most) |
| Data Processing Agreement required? | Yes (with all processors) | Yes (service provider agreements) | Yes (most) |
| Cross-border transfer restrictions? | Yes (SCCs, adequacy decisions) | Limited | Limited |
| Consent for profiling/targeting? | Yes (legitimate interest may apply for some) | Opt-out right | Varies |
| Cookie consent banner required? | Yes (prior consent) | Not specifically (but recommended) | Varies |
### Measurement-Specific Compliance Actions
- [ ] Privacy policy updated to disclose all tracking technologies and data sharing with ad platforms
- [ ] Data Processing Agreements (DPAs) signed with all analytics and ad platform vendors
- [ ] Consent records stored and auditable (which users consented, when, to what)
- [ ] Data subject requests (deletion, access) can be fulfilled within 30 days
- [ ] Server-side tracking processes only consented data (or aggregated, non-personal data)
- [ ] Hashing of PII occurs client-side before transmission to third parties
- [ ] Regular privacy audit of all tags, pixels, and server-side connections (quarterly minimum)
- [ ] Marketing team trained on privacy requirements relevant to their tools and workflows
- [ ] Legal review of any new tracking implementation before deployment
---
## Implementation Roadmap
### Phase 1: Foundation (Month 1)
- [ ] Deploy CMP with geo-based consent rules
- [ ] Implement Google Consent Mode v2
- [ ] Audit all existing tracking tags for consent compliance
- [ ] Enable Meta CAPI (use Shopify native or GTM server-side)
- [ ] Enable Google Enhanced Conversions
- [ ] Monitor consent rates and optimize banner UX
### Phase 2: First-Party Data (Month 2-3)
- [ ] Audit first-party data collection points (email, phone, account creation)
- [ ] Implement server-side event streaming for key conversions
- [ ] Set up first-party audience syncs to major ad platforms (Custom Audiences, Customer Match)
- [ ] Deploy deduplication between browser and server-side events
- [ ] Verify match rates across all platforms (target > 60%)
### Phase 3: Advanced Measurement (Month 3-6)
- [ ] Implement or commission Marketing Mix Modeling
- [ ] Design and run first incrementality test
- [ ] Evaluate data clean room options for cross-platform measurement
- [ ] Build privacy-compliant reporting dashboard with modeled conversions
- [ ] Establish quarterly measurement accuracy review
### Phase 4: Optimization (Ongoing)
- [ ] Continuously improve consent rates through UX optimization
- [ ] Expand first-party data collection (loyalty program, quizzes, progressive profiling)
- [ ] Calibrate MMM with incrementality test results
- [ ] Update privacy compliance as new regulations take effect
- [ ] Train team quarterly on evolving privacy landscape and measurement approaches
- [ ] Document measurement methodology and known limitations for stakeholder transparency
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |