12 cookie consent skills: TCF v2, CNIL compliance, cookie audit, GPC integration, server-side tracking, cookieless alternatives

version
1.0.0
GitHub stars
340

Install

/plugin install cookie-consent-skills@privacy-data-protection-skills

Run it inside Claude Code after adding the marketplace with /plugin marketplace add mukul975/Privacy-Data-Protection-Skills.

Contents

Discovered from source

Skills 12

Managing Consent for Analytics Cookies

Overview

Analytics cookies present a unique compliance challenge: they are among the most widely deployed non-essential cookies, yet many organizations depend on them for business intelligence. The ePrivacy Directive Article 5(3) requires consent for analytics cookies (they are not strictly necessary for the service requested by the user), confirmed by the Planet49 ruling. However, some Data Protection Authorities — notably the CNIL — have explored whether analytics can qualify for a consent exemption if configured with sufficient privacy safeguards. This skill covers compliant analytics implementation, consent mode fallback behavior, and alternatives that reduce or eliminate the need for consent.

GA4 Privacy Configuration

Privacy-First GA4 Setup for Pinnacle E-Commerce Ltd

Configure GA4 with maximum privacy protections:

GA4 Property Settings:

SettingValuePurpose
Data retention2 monthsMinimum needed for trend analysis
Reset user data on new activityEnabledDo not extend retention on revisit
IP anonymizationEnabled (default in GA4)Last octet removed before storage
Google SignalsDisabledPrevents cross-device tracking via Google account
Granular locationDisabledCity-level only, no GPS/precise location
Device data collectionDisabledReduces device fingerprinting surface
Data sharing with GoogleDisabledPrevents data use for Google benchmarking/products
Ads personalizationDisabledNo remarketing audiences from analytics
User ID featureDisabled unless explicit consentRequires separate consent if linking sessions

GA4 Data Stream Settings:

SettingValue
Enhanced measurementSelective — enable page views, scrolls; disable site search, file downloads unless needed
Cross-domain trackingOnly between pinnacle-ecommerce.com subdomains
Referral exclusionsAdd payment processors (stripe.com, paypal.com)
Internal traffic filteringExclude office IP ranges

Consent Mode Integration

GA4 behavior changes based on analytics_storage consent state:

When analytics_storage = granted:

  • _ga cookie set (client ID persisted)
  • _gid cookie set (session distinction)
  • Full event data collected
  • User-level and session-level reporting available
  • Real-time reports populated

When analytics_storage = denied:

  • No analytics cookies set
  • Cookieless pings sent to Google (if Consent Mode enabled)
  • Pings include: timestamp, page path, user agent, referrer, consent state
  • Pings do NOT include: client ID, session ID, user ID
  • GA4 uses behavioral modeling to estimate metrics from these pings
  • Modeled data appears in reports with a "modeled" badge

Behavioral Modeling Thresholds

For GA4 to provide modeled data for non-consenting users:

RequirementMinimum
Consented daily users1,000+ per web data stream
Consecutive days of data7+ days
Consent Mode implementationOn all GA4 tags
Data quality< 10% bot traffic

If thresholds are not met, GA4 reports will show only consented users — creating an undercount.

Analytics Without Consent — CNIL Exemption Criteria

CNIL Cookie Exemption for Audience Measurement

The CNIL published guidance (September 2020, updated June 2021) identifying limited conditions under which audience measurement cookies may be exempt from consent under ePrivacy Article 5(3). This is an interpretation specific to French law (transposition of ePrivacy Directive) and is not universally accepted across all EU member states.

CNIL Exemption Conditions:

ConditionRequirement
Purpose limitationStrictly limited to anonymous audience measurement on behalf of the publisher only
No cross-site trackingData must not be combined across different websites or apps
No data sharingData must not be shared with third parties
Cookie lifetimeMaximum 13 months
Data retentionMaximum 25 months from collection
IP addressAnonymized or not collected
User notificationUsers must still be informed about the cookies (even without consent)
Opt-out mechanismUsers must be able to object to the measurement

CNIL-Exempt Analytics Tools:

The CNIL maintains a list of analytics solutions that can be configured to meet exemption criteria:

ToolCNIL Exempt ConfigurationNotes
Matomo (self-hosted)Yes — with specific configNo data sharing, anonymized IP, 13-month cookie, self-hosted
AT Internet (Piano Analytics)Yes — exempt modeFrench analytics provider, certified by CNIL
Eulerian AnalyticsYes — exempt modeFirst-party data processing, no cross-site
Abla AnalyticsYes — privacy-by-designDesigned for CNIL exemption
Google Analytics 4No — does not meet exemptionData transferred to Google; cross-site processing

GA4 Cannot Qualify for CNIL Exemption Because:

  1. Data is processed by Google (a third party)
  2. Data may be combined with other Google services
  3. Data is transferred to the United States
  4. Google retains control over processing purposes

Implementing Matomo as CNIL-Exempt Alternative

For Pinnacle E-Commerce Ltd, deploy Matomo alongside GA4:

Matomo CNIL-Exempt Configuration:

SettingValue
HostingSelf-hosted on EU servers (pinnacle-ecommerce.com infrastructure)
Cookie lifetime13 months maximum
IP anonymizationFull anonymization (2 bytes masked for IPv4)
Do Not TrackRespected
Data retentionVisitor logs: 25 months; aggregated reports: indefinite
Cross-site trackingDisabled
Third-party data sharingNone
User opt-outJavaScript opt-out widget on cookie policy page
Session fingerprintingDisabled — use cookie-based session only

Dual Analytics Architecture:

Page Load
    │
    ├── Always fire (no consent needed):
    │   └── Matomo (CNIL-exempt configuration)
    │       └── Basic pageview, session, referrer data
    │
    └── Fire only with analytics consent:
        └── GA4 (full measurement)
            └── Enhanced measurement, events, conversions

This gives Pinnacle E-Commerce Ltd baseline analytics for all users (via Matomo) and richer data for consenting users (via GA4).

Aggregate Reporting Alternatives

Privacy-Preserving Measurement Approaches

ApproachConsent RequiredData GranularityImplementation
Server-side log analysisNo (essential for operations)AggregateParse access logs for page views, status codes
Matomo (CNIL-exempt config)No (France only)Per-sessionSelf-hosted, privacy-configured
GA4 with Consent ModeYes (consent improves data)User-level (modeled for non-consenting)Standard implementation
Plausible AnalyticsDepends on jurisdictionAggregateNo cookies, no PII, EU-hosted
Fathom AnalyticsDepends on jurisdictionAggregateNo cookies, no PII
Privacy Sandbox Attribution ReportingEvolvingAggregateChrome-only, limited availability

Server-Side Log Analytics

The most privacy-preserving approach uses existing server access logs:

Available Metrics from Access Logs:

MetricSourceProcessing
Page viewsHTTP request countCount 200-status HTML requests
Unique visitors (daily)IP + User Agent hashHash and count distinct per day
Top pagesRequest URIRank by request count
ReferrersReferer headerParse and categorize
Device typesUser-Agent headerParse UA for device category
Geographic distributionIP geolocationResolve to country, discard IP
Error ratesHTTP status codesCount 4xx, 5xx responses
Page load performanceServer response timeMeasure TTFB from logs

Limitations:

  • No client-side event tracking (clicks, scrolls, form interactions)
  • No session stitching across pages (without cookies)
  • No conversion attribution
  • Bot traffic must be filtered (estimated 30-50% of web traffic)

Consent Rate Impact Analysis

Typical analytics consent rates observed across industries:

Consent Banner DesignAnalytics Consent RateImpact on GA4 Data
Accept All prominent, Reject buried80-90%Low data loss
Equal prominence (CNIL-compliant)40-60%Significant data loss
Reject All as default action20-35%Severe data loss
Cookie wall (non-compliant)90%+Artificially high — non-compliant

Pinnacle E-Commerce Ltd Expected Impact: With a CNIL-compliant equal-prominence banner, expect approximately 45-55% analytics consent rate. This means:

  • GA4 direct measurement covers ~50% of users
  • Consent Mode behavioral modeling recovers ~20-30% of lost data
  • Combined coverage: ~70-80% of actual traffic
  • Matomo (CNIL-exempt) provides 100% coverage for basic metrics

Key Legal and Technical References

  • ePrivacy Directive 2002/58/EC, Article 5(3) — Consent required for analytics cookies (not strictly necessary)
  • CJEU Case C-673/17 (Planet49) — Active consent for all non-essential cookies including analytics
  • CNIL Deliberation No. 2020-091 (17 September 2020) — Cookie guidelines including audience measurement exemption
  • CNIL Guidelines on Audience Measurement Exemption (June 2021) — Conditions for consent-exempt analytics
  • EDPB Guidelines 05/2020 on Consent — Analytics cookies require consent under GDPR
  • Google Analytics 4 Privacy Documentation — GA4 data controls, consent mode, data retention
  • Matomo GDPR/CNIL Compliance Guide — Self-hosted configuration for consent exemption
  • Austrian DPA Decision (December 2021, DSB D155.027) — Found Google Analytics non-compliant with GDPR due to US data transfers
  • CNIL Decision on Google Analytics (February 2022) — Ordered website to comply or cease using GA; US transfer concern

CNIL-Compliant Cookie Banner Implementation

Overview

The Commission Nationale de l'Informatique et des Libertés (CNIL) enforces some of the strictest cookie consent requirements in the EU. Following its updated guidelines (Deliberation No. 2020-091 of 17 September 2020) and landmark enforcement actions — including the EUR 100 million fine against Google LLC and EUR 50 million against Google Ireland Limited (31 December 2021), and the EUR 60 million fine against Meta Platforms Ireland Limited (31 December 2022, later increased in subsequent actions totaling EUR 150 million across multiple decisions) — organizations serving French users must implement cookie banners meeting specific design and functional requirements.

CNIL Cookie Banner Requirements

1. Equal Prominence for Accept and Reject

The CNIL requires that the mechanism to refuse cookies must be as easy to use as the mechanism to accept them. This was the central issue in the Google and Meta enforcement actions — both companies provided a prominent "Accept All" button but required multiple clicks to reject cookies.

Compliant Design for Pinnacle E-Commerce Ltd:

+------------------------------------------------------------------+
|  Pinnacle E-Commerce uses cookies                                |
|                                                                  |
|  We use cookies to improve your shopping experience, analyse     |
|  site traffic, and personalise content. You can accept all       |
|  cookies, reject non-essential cookies, or customise your        |
|  choices.                                                        |
|                                                                  |
|  [Accept All]    [Reject All]    [Customise]                     |
|                                                                  |
|  Privacy Policy  |  Cookie Policy                                |
+------------------------------------------------------------------+

Design Rules:

  • "Accept All" and "Reject All" buttons must have identical visual weight: same size, same font, same color scheme, same position hierarchy
  • Neither button may use dark patterns (e.g., bright color for accept, grey for reject)
  • A "Customise" or "Manage Preferences" option must also be available at the same level
  • The banner must not use manipulative language ("Accept for the best experience" vs. neutral "Reject All")

2. No Cookie Walls

Under CNIL guidelines, access to the website must not be conditioned on accepting cookies. Cookie walls — where content is blocked until the user accepts all cookies — are prohibited.

Prohibited Implementation:

+------------------------------------------------------------------+
|  To access Pinnacle E-Commerce, please accept our cookies.       |
|                                                                  |
|  [Accept All Cookies]                                            |
+------------------------------------------------------------------+

Compliant Alternative: The site must be fully functional (at minimum, browsable) when the user clicks "Reject All." Essential cookies for cart functionality, authentication, and security may still be set under the strictly necessary exemption.

3. Granular Purpose-Level Consent

The customisation layer must allow users to consent to each purpose individually:

Layer 2 — Customise Preferences:

+------------------------------------------------------------------+
|  Manage your cookie preferences                                  |
|                                                                  |
|  Strictly Necessary          [Always Active]                     |
|  Required for the site to function (cart, security, login).      |
|  These cannot be disabled.                                       |
|                                                                  |
|  Analytics                   [Toggle OFF]                        |
|  Help us understand how visitors use the site to improve our     |
|  services. Data is aggregated and anonymised.                    |
|  Partners: Google Analytics                                      |
|                                                                  |
|  Advertising                 [Toggle OFF]                        |
|  Used to show you relevant advertisements on other websites.     |
|  Partners: Meta, Google Ads                                      |
|                                                                  |
|  Functionality               [Toggle OFF]                        |
|  Remember your preferences such as language and currency.        |
|                                                                  |
|  [Confirm My Choices]    [Accept All]    [Reject All]            |
+------------------------------------------------------------------+

Rules for Layer 2:

  • All non-essential toggles default to OFF (no pre-ticked consent)
  • Each category lists specific third-party partners by name
  • "Confirm My Choices" saves the current toggle state
  • "Accept All" and "Reject All" remain available at this level too

4. Consent Validity and Reconsent

CNIL recommends that consent be renewed at regular intervals:

ParameterCNIL Requirement
Maximum consent validity6 months (CNIL recommendation)
Refusal retention6 months before re-prompting
Consent proof retentionDuration of consent + applicable statute of limitations
Re-prompt after consent expiryBanner must reappear automatically
Re-prompt after cookie policy changeMandatory — new consent required

Implementation for Pinnacle E-Commerce Ltd:

Store the consent timestamp in a first-party cookie:

cookie_consent_timestamp=2026-01-15T10:30:00Z
cookie_consent_version=v2.3
cookie_consent_state=accepted_analytics|rejected_advertising|accepted_functionality

On each page load, check:

  1. Does cookie_consent_timestamp exist?
  2. Is it less than 6 months old?
  3. Does cookie_consent_version match the current cookie policy version?

If any check fails, redisplay the banner.

5. No Deceptive Design Patterns

CNIL specifically prohibits the following dark patterns:

Dark PatternDescriptionWhy Prohibited
Asymmetric buttonsAccept is large/colorful, reject is small/greyUnequal prominence violates equal ease requirement
Hidden rejectReject option buried in settings layersMust be at same level as accept
Confusing togglesToggle visually suggests ON when it is OFFUndermines informed consent
Guilt-tripping"By rejecting, you'll miss personalised offers"Manipulative language
Pre-selected purposesAnalytics or functionality toggles pre-enabledViolates active consent requirement (Planet49)
Repeated promptingRe-showing banner on every page after rejectionCoercion; must respect refusal for 6 months

Technical Implementation

Banner Loading Behavior

  1. No cookies before consent: Non-essential cookies must not be set before the user interacts with the banner. Tags must be blocked at the container level.
  2. Synchronous banner load: The consent banner must load before any tag management scripts execute.
  3. Server-side enforcement: Consent state should be validated server-side for requests that trigger cookie setting.

Tag Blocking Architecture

Page Load
    │
    ├── Load consent banner script (synchronous)
    │
    ├── Check consent state cookie
    │   ├── No consent recorded → Show banner, block all non-essential tags
    │   ├── Consent expired (>6 months) → Show banner, block all non-essential tags
    │   ├── Consent recorded → Parse consent state
    │       ├── Analytics accepted → Fire GA4 tags
    │       ├── Advertising accepted → Fire Meta Pixel, Google Ads tags
    │       └── Functionality accepted → Fire preference cookies
    │
    └── User interacts with banner
        ├── Accept All → Set all tags, store consent
        ├── Reject All → Block all non-essential tags, store refusal
        └── Customise → Show Layer 2, await per-purpose selection

Consent Storage

Store consent proof with the following minimum fields:

FieldValue
Consent IDUUID per consent event
User identifierPseudonymised user ID or cookie ID
TimestampISO 8601 UTC
Banner versionHash of banner text/design
Cookie policy versionVersion identifier (e.g., v2.3)
DecisionsPer-purpose accept/reject
Collection mechanism"cookie_banner_layer_1" or "cookie_banner_layer_2"
IP addressFor geolocation verification (retained separately, access-restricted)

Accessibility Requirements

The cookie banner must meet WCAG 2.1 Level AA:

  • Keyboard navigable (Tab, Enter, Escape)
  • Screen reader compatible (ARIA roles, labels)
  • Sufficient color contrast (4.5:1 ratio minimum)
  • Focus trap within banner until interaction (preventing interaction with page behind)
  • Banner text at minimum 14px font size

CNIL Enforcement Precedents

DateOrganizationFineKey Violation
31 Dec 2021Google LLCEUR 100,000,000No equivalent reject mechanism; cookies set before consent
31 Dec 2021Google IrelandEUR 50,000,000Same violations as Google LLC
29 Dec 2022TikTokEUR 5,000,000No equivalent reject mechanism
31 Dec 2022Meta Platforms IrelandEUR 60,000,000No equivalent reject mechanism
15 Jun 2023CriteoEUR 40,000,000Consent not freely given; insufficient information
28 Dec 2023Amazon FranceEUR 32,000,000Cookie deposits without consent

Key Legal References

  • CNIL Deliberation No. 2020-091 (17 September 2020) — Guidelines on cookies and other trackers
  • CNIL Recommendation on cookies (1 October 2020) — Practical modalities for consent collection
  • ePrivacy Directive 2002/58/EC, Article 5(3) — Consent for storing/accessing information on devices
  • CJEU Case C-673/17 (Planet49) — Active consent, no pre-ticked boxes
  • GDPR Article 7 — Conditions for consent, including withdrawal
  • CNIL Decision SAN-2021-023 (Google) — EUR 150M total fine for cookie consent violations
  • CNIL Decision SAN-2022-021 (Meta) — EUR 60M fine for cookie consent violations

Auditing Website Cookies and Trackers

Overview

A cookie audit is the foundational step in achieving cookie consent compliance. It involves systematically identifying, categorizing, and documenting every cookie and tracking technology deployed on a website. The Court of Justice of the European Union in Planet49 GmbH v. Bundesverband der Verbraucherzentralen (Case C-673/17, 1 October 2019) established that pre-ticked checkboxes do not constitute valid consent under the ePrivacy Directive, and that users must be informed about cookie duration and third-party access before consenting. A thorough audit reveals what consent must be obtained and what disclosures must be made.

Audit Methodology

Phase 1: Preparation

Before scanning, document the audit scope for Pinnacle E-Commerce Ltd:

ParameterValue
Primary domainwww.pinnacle-ecommerce.com
Subdomains in scopeshop.pinnacle-ecommerce.com, account.pinnacle-ecommerce.com, blog.pinnacle-ecommerce.com
Authenticated pagesYes — customer account, checkout flow
Mobile-specific pagesm.pinnacle-ecommerce.com
Third-party integrationsGoogle Analytics 4, Meta Pixel, Hotjar, Stripe, Intercom
Scan frequencyQuarterly (next: Q2 2026)

Phase 2: Automated Scanning

Deploy scanning tools to capture all cookies and tracking technologies:

Browser-Based Scanning

Use a headless Chromium instance to crawl the site and capture:

  • First-party cookies set via Set-Cookie headers
  • First-party cookies set via document.cookie JavaScript API
  • Third-party cookies from embedded resources
  • LocalStorage and SessionStorage entries
  • IndexedDB databases
  • Pixels and beacons (1x1 image requests, navigator.sendBeacon() calls)
  • Browser fingerprinting scripts (canvas, WebGL, AudioContext)

Network-Level Capture

Monitor HTTP/HTTPS traffic to identify:

  • Tracking parameters in URL query strings (utm_*, fbclid, gclid)
  • Redirect chains through tracking domains
  • Cookie syncing between third parties
  • Server-to-server data sharing endpoints

Phase 3: Cookie Categorization

Classify each cookie using the ICC UK Cookie Guide categories, aligned with the ePrivacy Directive Article 5(3):

Category 1: Strictly Necessary Cookies essential for the website to function. No consent required under Article 5(3) exemption.

Examples for Pinnacle E-Commerce Ltd:

Cookie NameDomainDurationPurpose
session_id.pinnacle-ecommerce.comSessionMaintains user session state
csrf_token.pinnacle-ecommerce.comSessionCross-site request forgery protection
cart_itemsshop.pinnacle-ecommerce.com24 hoursShopping cart contents
auth_tokenaccount.pinnacle-ecommerce.com30 minutesAuthentication state
load_balancer.pinnacle-ecommerce.comSessionServer load distribution

Category 2: Performance/Analytics Cookies that collect aggregate usage data. Consent required.

Cookie NameDomainDurationPurpose
_ga.pinnacle-ecommerce.com2 yearsGoogle Analytics client ID
_ga_XXXXXXX.pinnacle-ecommerce.com2 yearsGA4 session persistence
_gid.pinnacle-ecommerce.com24 hoursGA4 session distinction
hjSessionUser*.pinnacle-ecommerce.com1 yearHotjar user identification
hjSession*.pinnacle-ecommerce.com30 minutesHotjar session data

Category 3: Functionality Cookies that remember user preferences. Consent required unless strictly necessary.

Cookie NameDomainDurationPurpose
locale.pinnacle-ecommerce.com1 yearLanguage preference
currencyshop.pinnacle-ecommerce.com1 yearCurrency selection
recently_viewedshop.pinnacle-ecommerce.com30 daysRecently viewed products

Category 4: Targeting/Advertising Cookies used for ad targeting and cross-site tracking. Consent always required.

Cookie NameDomainDurationPurpose
_fbp.pinnacle-ecommerce.com90 daysMeta Pixel browser ID
_fbc.pinnacle-ecommerce.com90 daysMeta click identifier
_gcl_au.pinnacle-ecommerce.com90 daysGoogle Ads conversion linker
IDE.doubleclick.net13 monthsGoogle ad serving
fr.facebook.com90 daysMeta ad delivery and measurement

Phase 4: Gap Analysis

For each cookie identified, verify against Planet49 requirements:

Planet49 Compliance Checklist:

  1. Active consent mechanism: Is consent collected via affirmative action (click, toggle), not pre-ticked boxes? (Planet49, para. 62)
  2. Pre-consent information: Before consent is given, is the user informed of:
    • Cookie duration? (Planet49, para. 81)
    • Whether third parties have access? (Planet49, para. 81)
    • The specific purpose of each cookie category?
  3. Granularity: Can users consent to cookie categories individually, not just accept all?
  4. No cookie walls: Is site access available without consenting to non-essential cookies?
  5. Withdrawal mechanism: Can users withdraw consent as easily as they gave it?

Gap Analysis Template:

CookieCategoryConsent CollectedDuration DisclosedThird-Party DisclosedGap
_gaAnalyticsYesNo — listed as "persistent" not "2 years"No — Google not namedDuration + third-party disclosure
_fbpTargetingYesYesYesNone
localeFunctionalityNoNoN/AAssess if strictly necessary

Phase 5: Reporting

The audit report for Pinnacle E-Commerce Ltd must include:

  1. Executive summary: Total cookies found, breakdown by category, critical gaps
  2. Complete cookie inventory: Full table with name, domain, duration, purpose, category, legal basis
  3. Third-party tracker inventory: All third-party domains receiving data, with data types shared
  4. Compliance gap register: Each gap, severity (high/medium/low), remediation recommendation
  5. Cookie policy update recommendations: Specific text changes needed
  6. Consent mechanism assessment: Whether current banner meets Planet49 requirements
  7. Recommended scan schedule: Quarterly for production, on-demand for new feature deployments

Ongoing Monitoring

Schedule automated scans to detect new cookies introduced by:

  • Developer deployments (new analytics or marketing tags)
  • Third-party script updates (vendor SDK updates adding new cookies)
  • A/B testing platforms adding experiment cookies
  • CDN or infrastructure changes

Integrate cookie scanning into the CI/CD pipeline: any new cookie detected in staging must be categorized and documented before deployment to production.

Key Legal References

  • CJEU Case C-673/17 (Planet49) — Active consent required; pre-ticked boxes invalid; cookie duration and third-party access must be disclosed before consent
  • ePrivacy Directive 2002/58/EC, Article 5(3) — Consent required for storing/accessing information on user devices, with strictly necessary exemption
  • GDPR Article 4(11) — Definition of consent: freely given, specific, informed, unambiguous indication
  • EDPB Guidelines 05/2020 on Consent — Detailed guidance on valid consent mechanisms
  • ICC UK Cookie Guide (2012) — Cookie categorization framework (strictly necessary, performance, functionality, targeting)
  • CNIL Deliberation No. 2020-091 (17 September 2020) — Guidelines on cookies and other trackers

Automated Cookie Consent Validation

Overview

Manual cookie consent testing is insufficient for modern web applications where deployments occur multiple times daily and third-party scripts update independently. Automated testing using browser automation frameworks — Selenium and Playwright — enables continuous verification that the cookie consent banner functions correctly, that non-essential cookies are blocked before consent, that consent choices are respected, and that tag firing aligns with the user's consent state. Integrating these tests into the CI/CD pipeline ensures that every deployment is verified for cookie compliance before reaching production.

Test Architecture

Test Categories

CategoryWhat It TestsWhen to Run
Banner displayBanner appears on first visit; correct layout and textEvery deployment
Pre-consent blockingNo non-essential cookies/tags before user interactionEvery deployment
Consent acceptanceAccept All sets correct cookies and fires correct tagsEvery deployment
Consent rejectionReject All blocks all non-essential cookies and tagsEvery deployment
Granular consentPer-category toggles work correctlyEvery deployment
Consent persistenceConsent state survives page navigation and browser restartDaily
Consent withdrawalChanging consent removes cookies and stops tagsWeekly
Consent expiryBanner re-appears after consent expiresMonthly
GPC signalGPC header triggers automatic opt-outEvery deployment
RegressionNew cookies not introduced without documentationEvery deployment

Test Environment Setup

Playwright Configuration for Pinnacle E-Commerce Ltd:

// playwright.config.js
const { defineConfig, devices } = require('@playwright/test');

module.exports = defineConfig({
  testDir: './tests/cookie-consent',
  timeout: 30000,
  retries: 1,
  use: {
    baseURL: 'https://staging.pinnacle-ecommerce.com',
    trace: 'on-first-retry',
    screenshot: 'only-on-failure',
  },
  projects: [
    {
      name: 'chromium',
      use: { ...devices['Desktop Chrome'] },
    },
    {
      name: 'firefox',
      use: { ...devices['Desktop Firefox'] },
    },
    {
      name: 'webkit',
      use: { ...devices['Desktop Safari'] },
    },
    {
      name: 'mobile-chrome',
      use: { ...devices['Pixel 5'] },
    },
    {
      name: 'mobile-safari',
      use: { ...devices['iPhone 13'] },
    },
  ],
});

Test Implementations

Test 1: Pre-Consent Cookie Blocking

Verify that no non-essential cookies are set before the user interacts with the consent banner.

// tests/cookie-consent/pre-consent-blocking.spec.js
const { test, expect } = require('@playwright/test');

const ESSENTIAL_COOKIES = [
  'session_id',
  'csrf_token',
  'consent_state',
  'load_balancer',
  'pinnacle_consent_eu',
  'pinnacle_consent_uk',
  'pinnacle_consent_ccpa',
];

const NON_ESSENTIAL_COOKIES = [
  '_ga',
  '_ga_',
  '_gid',
  '_fbp',
  '_fbc',
  '_gcl_au',
  '_hjSession',
  '_hjSessionUser',
  'IDE',
  'fr',
  'NID',
];

test.describe('Pre-Consent Cookie Blocking', () => {
  test('no non-essential cookies are set on page load before consent', async ({ page }) => {
    // Navigate to homepage without any prior consent
    await page.goto('/');

    // Wait for page to fully load including all third-party scripts
    await page.waitForLoadState('networkidle');

    // Get all cookies
    const cookies = await page.context().cookies();
    const cookieNames = cookies.map(c => c.name);

    // Verify no non-essential cookies exist
    for (const nonEssential of NON_ESSENTIAL_COOKIES) {
      const found = cookieNames.filter(name => name.startsWith(nonEssential));
      expect(found, `Non-essential cookie ${nonEssential} found before consent`).toHaveLength(0);
    }
  });

  test('no analytics network requests before consent', async ({ page }) => {
    const analyticsRequests = [];

    // Monitor network requests
    page.on('request', request => {
      const url = request.url();
      if (
        url.includes('google-analytics.com') ||
        url.includes('analytics.google.com') ||
        url.includes('facebook.com/tr') ||
        url.includes('connect.facebook.net') ||
        url.includes('hotjar.com')
      ) {
        analyticsRequests.push(url);
      }
    });

    await page.goto('/');
    await page.waitForLoadState('networkidle');

    expect(analyticsRequests, 'Analytics requests fired before consent').toHaveLength(0);
  });

  test('no localStorage tracking entries before consent', async ({ page }) => {
    await page.goto('/');
    await page.waitForLoadState('networkidle');

    const trackingKeys = await page.evaluate(() => {
      const suspicious = [];
      for (let i = 0; i < localStorage.length; i++) {
        const key = localStorage.key(i);
        if (key.startsWith('_hj') || key.startsWith('_ga') || key.includes('fb_')) {
          suspicious.push(key);
        }
      }
      return suspicious;
    });

    expect(trackingKeys, 'Tracking localStorage entries found before consent').toHaveLength(0);
  });
});

Test 2: Banner Display and Interaction

// tests/cookie-consent/banner-display.spec.js
const { test, expect } = require('@playwright/test');

test.describe('Cookie Banner Display', () => {
  test('banner appears on first visit', async ({ page }) => {
    await page.goto('/');

    // Banner should be visible
    const banner = page.locator('[data-testid="cookie-banner"]');
    await expect(banner).toBeVisible();
  });

  test('banner has Accept All button', async ({ page }) => {
    await page.goto('/');
    const acceptButton = page.locator('[data-testid="cookie-accept-all"]');
    await expect(acceptButton).toBeVisible();
    await expect(acceptButton).toHaveText(/Accept All/i);
  });

  test('banner has Reject All button with equal prominence', async ({ page }) => {
    await page.goto('/');
    const acceptButton = page.locator('[data-testid="cookie-accept-all"]');
    const rejectButton = page.locator('[data-testid="cookie-reject-all"]');

    await expect(rejectButton).toBeVisible();
    await expect(rejectButton).toHaveText(/Reject All/i);

    // Verify equal visual prominence (same size)
    const acceptBox = await acceptButton.boundingBox();
    const rejectBox = await rejectButton.boundingBox();

    expect(Math.abs(acceptBox.width - rejectBox.width)).toBeLessThan(10);
    expect(Math.abs(acceptBox.height - rejectBox.height)).toBeLessThan(5);
  });

  test('banner has Customise/Manage Preferences option', async ({ page }) => {
    await page.goto('/');
    const customiseButton = page.locator('[data-testid="cookie-customise"]');
    await expect(customiseButton).toBeVisible();
  });

  test('banner does not reappear after making a choice', async ({ page }) => {
    await page.goto('/');
    await page.locator('[data-testid="cookie-accept-all"]').click();

    // Navigate to another page
    await page.goto('/products');
    await page.waitForLoadState('networkidle');

    const banner = page.locator('[data-testid="cookie-banner"]');
    await expect(banner).not.toBeVisible();
  });

  test('banner is keyboard accessible', async ({ page }) => {
    await page.goto('/');
    await page.keyboard.press('Tab');

    // Focus should be within the banner
    const focusedElement = await page.evaluate(() => {
      const el = document.activeElement;
      return el ? el.closest('[data-testid="cookie-banner"]') !== null : false;
    });
    expect(focusedElement).toBe(true);
  });
});

Test 3: Consent State Verification

// tests/cookie-consent/consent-state.spec.js
const { test, expect } = require('@playwright/test');

test.describe('Consent State Verification', () => {
  test('Accept All sets all consent categories to granted', async ({ page }) => {
    await page.goto('/');
    await page.locator('[data-testid="cookie-accept-all"]').click();
    await page.waitForLoadState('networkidle');

    const cookies = await page.context().cookies();
    const consentCookie = cookies.find(c => c.name === 'pinnacle_consent_eu');

    expect(consentCookie).toBeTruthy();
    const consentState = JSON.parse(decodeURIComponent(consentCookie.value));
    expect(consentState.analytics).toBe(true);
    expect(consentState.advertising).toBe(true);
    expect(consentState.functionality).toBe(true);
  });

  test('Reject All sets all consent categories to denied', async ({ page }) => {
    await page.goto('/');
    await page.locator('[data-testid="cookie-reject-all"]').click();
    await page.waitForLoadState('networkidle');

    const cookies = await page.context().cookies();
    const consentCookie = cookies.find(c => c.name === 'pinnacle_consent_eu');

    expect(consentCookie).toBeTruthy();
    const consentState = JSON.parse(decodeURIComponent(consentCookie.value));
    expect(consentState.analytics).toBe(false);
    expect(consentState.advertising).toBe(false);
    expect(consentState.functionality).toBe(false);
  });

  test('Reject All blocks GA4 cookies', async ({ page }) => {
    await page.goto('/');
    await page.locator('[data-testid="cookie-reject-all"]').click();
    await page.waitForLoadState('networkidle');

    // Navigate to multiple pages to give GA4 time to attempt cookie setting
    await page.goto('/products');
    await page.waitForLoadState('networkidle');
    await page.goto('/about');
    await page.waitForLoadState('networkidle');

    const cookies = await page.context().cookies();
    const gaCookies = cookies.filter(c => c.name.startsWith('_ga'));
    expect(gaCookies).toHaveLength(0);
  });

  test('Granular consent: analytics only sets only analytics cookies', async ({ page }) => {
    await page.goto('/');

    // Open customisation layer
    await page.locator('[data-testid="cookie-customise"]').click();

    // Enable only analytics
    const analyticsToggle = page.locator('[data-testid="consent-toggle-analytics"]');
    await analyticsToggle.click();

    // Ensure advertising is off
    const advertisingToggle = page.locator('[data-testid="consent-toggle-advertising"]');
    const isAdvertisingChecked = await advertisingToggle.isChecked();
    expect(isAdvertisingChecked).toBe(false);

    // Confirm choices
    await page.locator('[data-testid="cookie-confirm-choices"]').click();
    await page.waitForLoadState('networkidle');

    const cookies = await page.context().cookies();
    const cookieNames = cookies.map(c => c.name);

    // GA cookies should be present
    expect(cookieNames.some(n => n.startsWith('_ga'))).toBe(true);

    // Advertising cookies should NOT be present
    expect(cookieNames.some(n => n === '_fbp')).toBe(false);
    expect(cookieNames.some(n => n === '_gcl_au')).toBe(false);
  });
});

Test 4: Tag Firing Audit

// tests/cookie-consent/tag-firing.spec.js
const { test, expect } = require('@playwright/test');

test.describe('Tag Firing Audit', () => {
  test('GA4 tag fires only after analytics consent', async ({ page }) => {
    let ga4Fired = false;

    page.on('request', request => {
      if (request.url().includes('google-analytics.com/g/collect') ||
          request.url().includes('analytics.google.com/g/collect')) {
        ga4Fired = true;
      }
    });

    // Load page — GA4 should not fire
    await page.goto('/');
    await page.waitForLoadState('networkidle');
    expect(ga4Fired, 'GA4 fired before consent').toBe(false);

    // Accept analytics
    await page.locator('[data-testid="cookie-customise"]').click();
    await page.locator('[data-testid="consent-toggle-analytics"]').click();
    await page.locator('[data-testid="cookie-confirm-choices"]').click();
    await page.waitForLoadState('networkidle');

    // Navigate to trigger a pageview
    await page.goto('/products');
    await page.waitForLoadState('networkidle');
    expect(ga4Fired, 'GA4 did not fire after analytics consent').toBe(true);
  });

  test('Meta Pixel does not fire when advertising is rejected', async ({ page }) => {
    let metaPixelFired = false;

    page.on('request', request => {
      if (request.url().includes('facebook.com/tr') ||
          request.url().includes('connect.facebook.net')) {
        metaPixelFired = true;
      }
    });

    await page.goto('/');
    await page.locator('[data-testid="cookie-reject-all"]').click();
    await page.waitForLoadState('networkidle');

    await page.goto('/products');
    await page.waitForLoadState('networkidle');
    await page.goto('/products/widget-pro');
    await page.waitForLoadState('networkidle');

    expect(metaPixelFired, 'Meta Pixel fired after reject all').toBe(false);
  });

  test('Google Consent Mode sends correct consent state', async ({ page }) => {
    const consentPings = [];

    page.on('request', request => {
      const url = request.url();
      if (url.includes('google-analytics.com') && url.includes('gcs=')) {
        const gcsMatch = url.match(/gcs=([^&]+)/);
        if (gcsMatch) consentPings.push(gcsMatch[1]);
      }
    });

    await page.goto('/');
    await page.locator('[data-testid="cookie-reject-all"]').click();
    await page.waitForLoadState('networkidle');

    // Navigate to trigger consent mode ping
    await page.goto('/products');
    await page.waitForLoadState('networkidle');

    // If consent mode pings are sent, verify denied state
    if (consentPings.length > 0) {
      for (const gcs of consentPings) {
        // G100 = all denied, G111 = all granted
        expect(gcs).toContain('100');
      }
    }
  });
});

Test 5: Cookie Regression Detection

// tests/cookie-consent/regression.spec.js
const { test, expect } = require('@playwright/test');
const fs = require('fs');

// Baseline of known cookies — update when new cookies are intentionally added
const KNOWN_COOKIES = new Set([
  'session_id',
  'csrf_token',
  'consent_state',
  'pinnacle_consent_eu',
  'load_balancer',
  '_ga',
  '_ga_PINNACLE',
  '_gid',
  '_fbp',
  '_fbc',
  '_gcl_au',
  '_hjSessionUser',
  '_hjSession',
  'locale',
  'currency',
  'recently_viewed',
  'cart_session',
  'auth_token',
]);

test.describe('Cookie Regression Detection', () => {
  test('no unknown cookies after Accept All', async ({ page }) => {
    await page.goto('/');
    await page.locator('[data-testid="cookie-accept-all"]').click();
    await page.waitForLoadState('networkidle');

    // Visit several pages to trigger all tag scenarios
    const pages = ['/', '/products', '/products/widget-pro', '/cart', '/about', '/blog'];
    for (const path of pages) {
      await page.goto(path);
      await page.waitForLoadState('networkidle');
    }

    const cookies = await page.context().cookies();
    const unknownCookies = cookies.filter(c => {
      // Check if cookie name matches any known prefix
      return !Array.from(KNOWN_COOKIES).some(known =>
        c.name === known || c.name.startsWith(known)
      );
    });

    if (unknownCookies.length > 0) {
      const unknownNames = unknownCookies.map(c => `${c.name} (domain: ${c.domain}, expires: ${c.expires})`);
      console.error('Unknown cookies detected:', unknownNames);

      // Write to report file for review
      fs.writeFileSync(
        'test-results/unknown-cookies.json',
        JSON.stringify(unknownCookies, null, 2)
      );
    }

    expect(unknownCookies, `Unknown cookies found: ${unknownCookies.map(c => c.name).join(', ')}`).toHaveLength(0);
  });
});

Test 6: GPC Signal Handling

// tests/cookie-consent/gpc-signal.spec.js
const { test, expect } = require('@playwright/test');

test.describe('Global Privacy Control Signal', () => {
  test('GPC signal triggers automatic opt-out for California users', async ({ browser }) => {
    // Create context with GPC header
    const context = await browser.newContext({
      extraHTTPHeaders: {
        'Sec-GPC': '1',
      },
      locale: 'en-US',
      geolocation: { latitude: 34.0522, longitude: -118.2437 }, // Los Angeles
      permissions: ['geolocation'],
    });

    const page = await context.newPage();
    await page.goto('/');
    await page.waitForLoadState('networkidle');

    // Verify advertising cookies are not set
    const cookies = await context.cookies();
    const adCookies = cookies.filter(c =>
      c.name === '_fbp' || c.name === '_gcl_au' || c.name.startsWith('IDE')
    );

    expect(adCookies, 'Advertising cookies set despite GPC signal').toHaveLength(0);

    await context.close();
  });
});

CI/CD Pipeline Integration

GitHub Actions Workflow

name: Cookie Consent Compliance Tests
on:
  push:
    branches: [main, staging]
  pull_request:
    branches: [main]
  schedule:
    - cron: '0 6 * * 1'  # Weekly Monday 6 AM UTC

jobs:
  cookie-consent-tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Install dependencies
        run: npm ci

      - name: Install Playwright browsers
        run: npx playwright install --with-deps

      - name: Run cookie consent tests
        run: npx playwright test tests/cookie-consent/
        env:
          BASE_URL: ${{ vars.STAGING_URL }}

      - name: Upload test results
        uses: actions/upload-artifact@v4
        if: always()
        with:
          name: cookie-consent-test-results
          path: |
            test-results/
            playwright-report/

      - name: Post results to Slack
        if: failure()
        uses: slackapi/slack-github-action@v1
        with:
          payload: |
            {
              "text": "Cookie consent tests FAILED on ${{ github.ref }}. Review: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
            }
        env:
          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_PRIVACY_WEBHOOK }}

Key Legal and Technical References

  • ePrivacy Directive 2002/58/EC, Article 5(3) — Legal requirement that automated tests verify
  • CJEU Case C-673/17 (Planet49) — Active consent requirements validated by banner interaction tests
  • CNIL Deliberation No. 2020-091 — Equal prominence requirement tested by button size comparison
  • CCPA/CPRA Cal. Civ. Code §1798.135(e) — GPC signal handling tested in GPC test suite
  • Playwright Documentation — Browser automation framework for cross-browser testing
  • WCAG 2.1 Level AA — Accessibility requirements tested by keyboard navigation tests
  • Google Consent Mode Documentation — Consent state parameters validated in tag firing tests

Auditing Cookie Lifetimes

Overview

Cookie lifetime is a critical compliance factor often overlooked in consent implementations. The CNIL recommends a maximum cookie lifetime of 13 months from the point of collection, after which consent must be renewed. The CJEU in Planet49 (Case C-673/17) established that cookie duration must be disclosed to users before consent is obtained. Additionally, browser-enforced restrictions — Safari's Intelligent Tracking Prevention (ITP), Firefox's Enhanced Tracking Protection (ETP), and Chrome's third-party cookie deprecation — impose technical limits on cookie lifetimes that may conflict with server-set durations. A cookie lifetime audit identifies cookies exceeding regulatory or technical limits and ensures accurate duration disclosure.

Cookie Duration Classification

Session vs. Persistent Cookies

TypeDurationBehaviorConsent Implications
Session cookieNo Expires or Max-Age attributeDeleted when browser closesStill requires consent if non-essential under ePrivacy Art. 5(3)
Persistent cookieHas Expires or Max-AgeSurvives browser restartRequires consent; duration must be disclosed (Planet49)
Server-refreshedReset on each visit via Set-CookieEffectively indefinite if user visits regularlyDuration is from last visit, not first set — must disclose rolling nature

Duration Categories

CategoryDuration RangeExamplesRegulatory Concern
Short-lived< 24 hoursSession IDs, CSRF tokensLow — typically strictly necessary
Medium-lived24 hours - 30 daysA/B test assignments, session replayMedium — review necessity
Long-lived30 days - 13 monthsAnalytics IDs, preference cookiesHigh — must justify duration
Excessive> 13 monthsLegacy tracking cookies, _ga (2 years)Very high — CNIL non-compliant duration

CNIL 13-Month Recommendation

Regulatory Basis

CNIL's Recommendation on Cookies (1 October 2020, following Deliberation 2020-091 of 17 September 2020) states:

"The duration of validity of the consent of the user to the deposit of trackers should not exceed thirteen months. At the end of this period, the consent of the user should be collected again."

This 13-month maximum applies to:

  • The consent cookie itself (the cookie that records the user's consent choice)
  • Non-essential tracking cookies (the cookies enabled by consent)

Impact on Common Cookies

Cookies Exceeding CNIL 13-Month Limit:

CookieDefault DurationSet ByCNIL CompliantRemediation
_ga2 years (730 days)Google AnalyticsNo — exceeds 13 monthsSet cookie_expires to 34128000 (395 days / ~13 months)
_ga_XXXXXXX2 yearsGA4No — exceeds 13 monthsSet cookie_expires to 34128000
IDE13 monthsDoubleClickBorderline compliantMonitor — at the limit
fr90 daysMeta/FacebookYesNo action needed
_gcl_au90 daysGoogle AdsYesNo action needed
hjSessionUser*1 yearHotjarYes — under 13 monthsNo action needed
NID6 monthsGoogle SearchYesNo action needed

GA4 Cookie Lifetime Configuration for Pinnacle E-Commerce Ltd

Override default GA4 cookie duration to comply with CNIL:

gtag.js implementation:

gtag('config', 'G-PINNACLE123', {
  'cookie_expires': 34128000,     // 395 days (~13 months) in seconds
  'cookie_update': true,           // Refresh cookie on each visit
  'cookie_domain': '.pinnacle-ecommerce.com',
  'cookie_flags': 'SameSite=Lax;Secure'
});

GTM implementation: In the GA4 Configuration tag, set the field:

  • Field name: cookie_expires
  • Value: 34128000

Browser-Enforced Lifetime Restrictions

Safari Intelligent Tracking Prevention (ITP)

Safari imposes strict cookie lifetime caps:

Cookie TypeITP RuleEffective Lifetime
Client-side JavaScript cookie (document.cookie)Capped at 7 days7 days maximum
Client-side JS cookie with link decoration (e.g., ?gclid=)Capped at 24 hours24 hours
Server-set cookie (Set-Cookie header), first-partyNo capAs set by server
Server-set cookie, classified as trackingCapped at 7 days7 days
Third-party cookieBlocked entirely0 (cannot be set)
LocalStorageCapped at 7 days7 days

Impact on Pinnacle E-Commerce Ltd:

  • GA4 _ga cookie set via JavaScript: Effective lifetime is 7 days on Safari, not 2 years
  • Server-side tagging (via data.pinnacle-ecommerce.com) sets _ga via Set-Cookie header: Full configured lifetime applies
  • Google Ads click IDs in URL parameters: _gcl_au cookie capped at 24 hours on Safari

Firefox Enhanced Tracking Protection (ETP)

SettingDefault (Standard)Strict
Third-party tracking cookiesBlockedBlocked
Cross-site tracking cookiesBlockedBlocked
First-party tracking cookiesAllowedLimited to 7 days (if tracker classified)
Fingerprinting scriptsBlockedBlocked
Cryptomining scriptsBlockedBlocked

Chrome Third-Party Cookie Changes

As of 2025, Chrome has moved toward a user-choice model for third-party cookies rather than full deprecation:

PhaseStatusImpact
Privacy Sandbox APIs availableActiveTopics API, Attribution Reporting API available
Third-party cookie user controlsActiveUsers can block third-party cookies in settings
IP Protection (Gnatcatcher)In developmentMay affect IP-based tracking

Cookie Lifetime Audit Process

Step 1: Extract Current Cookie Lifetimes

For each cookie on pinnacle-ecommerce.com, record:

Cookie NameDomainSet ByDeclared DurationActual Max-Age/ExpiresRefreshed on VisitCategory
_ga.pinnacle-ecommerce.comJavaScript2 yearsMax-Age=63072000YesAnalytics
_ga_PINNACLE.pinnacle-ecommerce.comJavaScript2 yearsMax-Age=63072000YesAnalytics
_gid.pinnacle-ecommerce.comJavaScript24 hoursMax-Age=86400YesAnalytics
_fbp.pinnacle-ecommerce.comJavaScript90 daysMax-Age=7776000NoAdvertising
_fbc.pinnacle-ecommerce.comJavaScript90 daysMax-Age=7776000NoAdvertising
_gcl_au.pinnacle-ecommerce.comJavaScript90 daysMax-Age=7776000NoAdvertising
session_id.pinnacle-ecommerce.comServerSessionNo Max-AgeN/ANecessary
csrf_token.pinnacle-ecommerce.comServerSessionNo Max-AgeN/ANecessary
locale.pinnacle-ecommerce.comServer1 yearMax-Age=31536000NoFunctionality
consent_state.pinnacle-ecommerce.comJavaScript6 monthsMax-Age=15768000NoNecessary

Step 2: Compare Against Limits

CookieServer-Set DurationCNIL 13-Month LimitSafari ITP LimitCompliantAction Required
_ga2 yearsExceeds7 days (JS)NoReduce to 13 months; move to server-side
_ga_PINNACLE2 yearsExceeds7 days (JS)NoReduce to 13 months; move to server-side
_gid24 hoursWithin7 days (JS)YesNone
_fbp90 daysWithin7 days (JS)PartialMove to server-side for Safari
locale1 yearWithinNo cap (server)YesNone
consent_state6 monthsWithin7 days (JS)PartialMove to server-side; aligns with CNIL 6-month reconsent

Step 3: Verify Disclosure Accuracy

Compare actual cookie lifetimes with durations stated in the cookie policy:

CookiePolicy StatesActual DurationAccurate
_ga"up to 2 years"2 yearsYes — but update to reflect 13-month override
_fbp"3 months"90 daysYes
locale"12 months"1 yearYes
_gid"24 hours"24 hoursYes

Step 4: Generate Remediation Plan

For Pinnacle E-Commerce Ltd:

  1. Immediate: Override GA4 cookie duration to 13 months (cookie_expires: 34128000)
  2. Short-term: Implement server-side tagging for _ga, _fbp cookies to bypass Safari ITP 7-day cap
  3. Medium-term: Implement automatic consent recollection at 6 months (CNIL reconsent cycle)
  4. Ongoing: Add cookie lifetime checks to CI/CD pipeline — flag any new cookie with duration > 13 months

Key Legal and Technical References

  • CNIL Deliberation No. 2020-091 (17 September 2020) — 13-month maximum cookie lifetime recommendation
  • CNIL Recommendation on Cookies (1 October 2020) — Practical implementation of lifetime limits
  • CJEU Case C-673/17 (Planet49), para. 81 — Cookie duration must be disclosed before consent
  • ePrivacy Directive 2002/58/EC, Article 5(3) — Consent required for non-essential cookie storage
  • Apple WebKit ITP Documentation — Safari cookie lifetime restrictions
  • Mozilla ETP Documentation — Firefox tracking protection policies
  • Google Privacy Sandbox Timeline — Chrome third-party cookie deprecation status
  • GDPR Article 5(1)(e) — Storage limitation principle applicable to cookie-stored personal data

Cookie-less Tracking Alternatives

Overview

The deprecation of third-party cookies by browsers and increasing consent-driven restrictions on first-party cookies are driving the advertising and analytics industries toward alternative measurement and targeting approaches. Google's Privacy Sandbox initiative, launched in 2019 and iteratively developed through 2024-2026, provides a suite of browser APIs designed to replace cross-site tracking functionality with privacy-preserving alternatives. Alongside browser-based solutions, server-side analytics and probabilistic measurement methods offer additional paths. This skill evaluates each alternative's privacy properties, technical requirements, and readiness for production use.

Privacy Sandbox APIs

Topics API

Purpose: Interest-based advertising without cross-site tracking.

How It Works:

  1. Chrome observes the user's browsing activity (top-level page visits) locally on-device
  2. Each week, the browser classifies visited sites into topics from a taxonomy of approximately 470 advertising-relevant categories
  3. When an ad tech company calls the Topics API on a publisher's site, the browser returns up to 3 topics (one from each of the last 3 weeks)
  4. Topics are selected with 5% random noise (a random topic is returned instead of the true one)
  5. A caller only receives topics that it has also observed the user being interested in (on other sites where the caller was present)

Topics Taxonomy Examples:

Topic IDCategoryLevel
1Arts & Entertainment1
57Arts & Entertainment / Movies2
86Business & Industrial / E-Commerce2
243Shopping / Apparel2
332Sports / Team Sports / Football3

Implementation for Pinnacle E-Commerce Ltd:

// Check if Topics API is available
if ('browsingTopics' in document) {
  // Observe: register this page visit for topic classification
  // The fetch call with {browsingTopics: true} both observes and retrieves
  const response = await fetch('https://ads.pinnacle-ecommerce.com/topics', {
    browsingTopics: true
  });
  const topics = await response.json();
  // topics = [{ topic: 86, version: "chrome.2:2:1", configVersion: "chrome.2", taxonomyVersion: "2", modelVersion: "1" }]
}

Privacy Properties:

  • No cross-site identifier shared
  • Topics are coarse-grained (470 categories, not granular interests)
  • 5% noise prevents deterministic profiling
  • Users can view and clear their topics in Chrome settings
  • Sites can opt out via Permissions-Policy: browsing-topics=()

Limitations:

  • Chrome-only (no Safari, Firefox support)
  • Coarse targeting compared to cookie-based audiences
  • Adoption depends on ad tech ecosystem support

Attribution Reporting API

Purpose: Measuring ad conversions without cross-site tracking.

Two Modes:

ModeReport TypeDataNoiseDelay
Event-levelPer-conversionSource: 64-bit ID; Trigger: 3 bits (8 values) for clicks, 1 bit for viewsYes (noise applied to trigger data)2 days (click), 1 day (view)
AggregatableAggregate summarySource + trigger combined into histogram bucketsAdditive Laplace noise10-60 minutes (batched)

Event-Level Attribution Flow:

1. User clicks ad on publisher.com
   → Browser stores: source_event_id=12345, destination=pinnacle-ecommerce.com

2. User converts on pinnacle-ecommerce.com
   → Browser matches: trigger_data=2 (e.g., "purchase")

3. After 2-day delay, browser sends report:
   {
     "source_event_id": "12345",
     "trigger_data": "2",
     "source_type": "navigation",
     "randomized_trigger_rate": 0.0024
   }
   → Sent to reporting origin (ads.pinnacle-ecommerce.com)

Aggregatable Attribution Flow:

1. Ad impression/click registered with source keys
2. Conversion triggers aggregation keys
3. Browser generates encrypted aggregatable report
4. Reports sent to aggregation service (Trusted Execution Environment)
5. Aggregation service applies differential privacy noise
6. Summary report returned: { "campaign_A_purchases": 1247 ± 23 }

Implementation for Pinnacle E-Commerce Ltd:

Source registration (on ad click):

<a href="https://www.pinnacle-ecommerce.com/product/widget-pro"
   attributionsrc="https://ads.pinnacle-ecommerce.com/register-source">
  Buy Widget Pro
</a>

Source registration response header:

Attribution-Reporting-Register-Source: {
  "destination": "https://www.pinnacle-ecommerce.com",
  "source_event_id": "12345678",
  "expiry": "604800",
  "aggregation_keys": {
    "campaignCounts": "0x159",
    "geoValue": "0x5"
  }
}

Trigger registration (on conversion):

<img src="https://ads.pinnacle-ecommerce.com/register-trigger" attributionsrc>

Trigger registration response header:

Attribution-Reporting-Register-Trigger: {
  "event_trigger_data": [
    { "trigger_data": "2", "priority": "100" }
  ],
  "aggregatable_trigger_data": [
    { "key_piece": "0x400", "source_keys": ["campaignCounts"] }
  ],
  "aggregatable_values": { "campaignCounts": 32768 }
}

Protected Audiences API (formerly FLEDGE)

Purpose: Remarketing and custom audience targeting without third-party cookies.

How It Works:

  1. Advertiser adds users to interest groups via JavaScript on their site
  2. Interest group data (ad creative URLs, bidding logic) stored locally in the browser
  3. When a publisher's ad slot runs an auction, the browser executes on-device bidding
  4. Winning ad is rendered in a fenced frame (isolated from the publisher page)
  5. No cross-site data leaves the browser; auction happens locally

Interest Group Join (on pinnacle-ecommerce.com):

navigator.joinAdInterestGroup({
  name: "widget-pro-viewers",
  owner: "https://ads.pinnacle-ecommerce.com",
  biddingLogicUrl: "https://ads.pinnacle-ecommerce.com/bidding.js",
  ads: [
    {
      renderUrl: "https://ads.pinnacle-ecommerce.com/ads/widget-pro-retarget.html",
      metadata: { "product": "widget-pro", "discount": "10%" }
    }
  ],
  userBiddingSignals: { "viewed_product": "widget-pro", "visit_count": 3 },
  trustedBiddingSignalsUrl: "https://ads.pinnacle-ecommerce.com/signals",
  trustedBiddingSignalsKeys: ["widget-pro-bid"],
  dailyUpdateUrl: "https://ads.pinnacle-ecommerce.com/update-ig",
  lifetimeMs: 2592000000  // 30 days
}, 2592000000);

Privacy Properties:

  • User profile data never leaves the device
  • Auction runs in browser, not on ad server
  • Fenced frames prevent information leakage to publisher
  • K-anonymity requirements on ad creatives (must be shown to sufficient users)
  • Users can view and leave interest groups in Chrome settings

Shared Storage API

Purpose: Cross-site data access with restricted output gates.

Allows writing data from multiple sites into a shared storage partition, but reading is restricted to privacy-preserving output gates:

  • Select URL (choose from a predefined list)
  • Private Aggregation (contribute to aggregate histograms)
  • Fenced Frames (render content without leaking data)

Use Case for Pinnacle E-Commerce Ltd: Frequency capping across sites — count how many times a user has seen an ad without cross-site cookies:

// On publisher site, inside shared storage worklet
class FrequencyCapOperation {
  async run(data) {
    const count = await this.sharedStorage.get('pinnacle-widget-pro-views') || 0;
    if (count >= 3) {
      // User has seen this ad 3 times — show fallback
      return 1; // Index of fallback URL
    }
    await this.sharedStorage.set('pinnacle-widget-pro-views', count + 1);
    return 0; // Index of ad URL
  }
}

Server-Side Analytics Alternatives

Cookieless Server-Side Measurement

SolutionCookiesPII CollectionHostingConsent Required
Server log analysisNoneIP address (anonymize)Self-hostedNo (operational necessity)
Plausible AnalyticsNoneNo PIIEU cloud or self-hostedVaries by jurisdiction
Fathom AnalyticsNoneNo PIICanadian/EU hostingVaries by jurisdiction
UmamiNone (optional)No PIISelf-hostedVaries by jurisdiction
Matomo (cookieless mode)NoneFingerprint hash (session only)Self-hostedCheck with local DPA

Plausible Analytics Configuration for Pinnacle E-Commerce Ltd

<!-- Single script, no cookies, ~1KB -->
<script defer data-domain="pinnacle-ecommerce.com"
  src="https://plausible.io/js/script.js"></script>

What Plausible Collects (per pageview):

  • Page URL (path only)
  • Referrer (domain only)
  • Browser (derived from User-Agent)
  • Operating system
  • Device type (desktop/mobile/tablet)
  • Country (from IP, IP discarded immediately)

What Plausible Does NOT Collect:

  • Cookies
  • Persistent identifiers
  • IP addresses (hashed for daily unique counting, hash rotated daily)
  • Cross-session tracking
  • Personal data

Comparison Matrix

CapabilityThird-Party CookiesTopics APIAttribution ReportingProtected AudiencesServer-Side Analytics
Interest-based targetingFull granularity~470 topicsNoRetargeting onlyNo
Conversion measurementDeterministicNoYes (with noise/delay)LimitedServer-side only
Cross-site trackingYesNoNoNoNo
Works in SafariNo (blocked)NoNoNoYes
Works in FirefoxNo (blocked)NoNoNoYes
Consent requiredYesEvolvingEvolvingEvolvingDepends on config
Production-readyLegacyYes (Chrome)Yes (Chrome)Yes (Chrome)Yes

Key Legal and Technical References

  • Google Privacy Sandbox Documentation — Topics API, Attribution Reporting, Protected Audiences specifications
  • W3C Private Advertising Technology Community Group — Standards development for privacy-preserving advertising
  • ePrivacy Directive 2002/58/EC, Article 5(3) — Legal basis for consent requirements; exemptions may apply to some alternatives
  • GDPR Recital 47 — Legitimate interest considerations for analytics
  • UK ICO Guidance on Analytics Cookies (2019, updated 2023) — Analytics cookies require consent under PECR
  • CNIL Topics API Analysis (2023) — French DPA assessment of Privacy Sandbox proposals
  • CMA (UK Competition and Markets Authority) Privacy Sandbox Commitments — Google's commitments regarding Privacy Sandbox development
  • IAB Tech Lab Privacy Sandbox Task Force — Industry evaluation of Privacy Sandbox APIs

Cross-Jurisdiction Cookie Compliance

Overview

Organizations operating websites accessible to users in multiple jurisdictions face divergent cookie consent requirements. The EU ePrivacy Directive mandates prior opt-in consent for non-essential cookies. The UK's Privacy and Electronic Communications Regulations (PECR) mirrors this approach post-Brexit. California's CCPA/CPRA follows an opt-out model where cookies may be set by default but users must be able to opt out of "sale" or "sharing" of personal information. Brazil's LGPD requires a legal basis for processing but does not have a specific cookie regulation equivalent to ePrivacy. This skill provides a jurisdiction-by-jurisdiction requirements matrix and a unified implementation strategy for Pinnacle E-Commerce Ltd.

Jurisdiction Requirements Matrix

Cookie Consent Models by Jurisdiction

JurisdictionLegal FrameworkConsent ModelDefault StateKey Requirement
EU (27 member states)ePrivacy Directive 2002/58/EC + GDPROpt-inAll non-essential blockedPrior informed consent; no pre-ticked boxes (Planet49)
FranceePrivacy + Loi Informatique et Libertés + CNIL GuidelinesOpt-in (strict)All non-essential blockedEqual prominence accept/reject; 6-month reconsent; 13-month cookie max
GermanyTTDSG (Telekommunikation-Telemedien-Datenschutz-Gesetz) + GDPROpt-inAll non-essential blockedConsent required per Section 25 TTDSG; BGH Planet49 implementation
UKPECR (SI 2003/2426) + UK GDPROpt-inAll non-essential blockedSame as EU ePrivacy; ICO enforcement
California, USCCPA/CPRA (Cal. Civ. Code §1798.100 et seq.)Opt-outCookies may be set by default"Do Not Sell or Share My Personal Information" link; honor GPC signal
Colorado, USCPA (C.R.S. § 6-1-1301 et seq.)Opt-outCookies may be set by defaultUniversal opt-out mechanism recognized
Connecticut, USCTDPA (P.A. 22-15)Opt-outCookies may be set by defaultHonor universal opt-out signals
Virginia, USVCDPA (Va. Code § 59.1-575 et seq.)Opt-outCookies may be set by defaultOpt-out of targeted advertising and sale
BrazilLGPD (Lei 13.709/2018)Legal basis requiredDepends on legal basis claimedConsent or legitimate interest; ANPD guidance evolving
CanadaPIPEDA + proposed CPPA (Bill C-27)Implied consent (evolving)May be set with noticeMeaningful consent; implied consent may suffice for some cookies
South KoreaPIPA (amended 2023) + Act on Promotion of IT NetworkOpt-in for trackingNon-essential blockedConsent for tracking cookies; strict enforcement
JapanAPPI (amended 2022) + Cookie regulation (2023)Opt-in for third-party sharingVariesConsent if cookie data shared with third parties

Detailed Requirements Comparison

RequirementEU ePrivacyUK PECRCalifornia CCPA/CPRABrazil LGPD
Prior consent for analyticsYesYesNo (opt-out model)Depends on legal basis
Prior consent for advertisingYesYesNo (opt-out model)Yes (consent recommended)
Consent for strictly necessaryNo (exempt)No (exempt)Not applicableNot applicable
Cookie wall allowedNoNoNo (service cannot be denied)No
Equal prominence accept/rejectYes (CNIL, some DPAs)Recommended (ICO)N/A (opt-out model)Not specified
Must honor GPC/DNTNo legal requirement (but EDPB encourages)No legal requirementYes — GPC = valid opt-outNot specified
Consent record requiredYes (GDPR Art. 7(1))Yes (UK GDPR Art. 7(1))No (but recommended)Yes (LGPD Art. 8, §2)
Maximum cookie lifetime13 months (CNIL)Not specifiedNot specifiedNot specified
Reconsent frequency6 months (CNIL); varies by DPANot specifiedN/ANot specified
Opt-out link requiredNo (but withdrawal must be easy)NoYes — "Do Not Sell or Share"No
Privacy policy cookie sectionYesYesYesYes
Child-specific requirementsGDPR Art. 8 (age 16, or member state minimum 13)UK GDPR Art. 8 (age 13) + Age Appropriate Design CodeCCPA under-16 opt-in requiredLGPD Art. 14 (best interest of child)

Geolocation-Based Implementation

Architecture for Pinnacle E-Commerce Ltd

User Request
    │
    ├── Determine user jurisdiction
    │   ├── Primary: IP geolocation (MaxMind GeoIP2 or similar)
    │   ├── Secondary: Accept-Language header
    │   ├── Tertiary: User account country setting
    │   └── Fallback: Most restrictive (EU opt-in)
    │
    ├── Select consent configuration
    │   ├── EU/UK → Opt-in banner (full CNIL-style for FR)
    │   ├── US-CA → Opt-out with "Do Not Sell or Share" link
    │   ├── US-CO/CT/VA → Opt-out with universal opt-out support
    │   ├── US-other → Notice-only (monitor state law developments)
    │   ├── Brazil → Consent banner (LGPD legal basis)
    │   └── Other → Apply most restrictive applicable standard
    │
    └── Load appropriate consent experience

Configuration by Jurisdiction

EU/EEA Configuration:

SettingValue
Banner typeOpt-in with equal accept/reject
Default cookie stateAll non-essential denied
Tags blocked before consentGA4, Meta Pixel, Hotjar, Google Ads, all advertising
Consent storageFirst-party cookie + server-side record
Reconsent interval6 months (CNIL standard; apply across EU for simplicity)
Cookie max lifetime13 months
GPC signal handlingTreat as opt-out of advertising/targeting

UK Configuration:

SettingValue
Banner typeOpt-in with clear accept/reject
Default cookie stateAll non-essential denied
Tags blocked before consentSame as EU
Legal framework referencePECR Regulation 6
ICO-specificLink to ICO cookie guidance in policy
Reconsent interval12 months (ICO does not specify; annual is prudent)

California Configuration:

SettingValue
Banner typeNotice banner with opt-out link
Default cookie stateAll cookies set by default
Required link"Do Not Sell or Share My Personal Information" in footer
GPC signalMust be honored as valid opt-out (Cal. Civ. Code §1798.135(e))
Opt-out scopeAdvertising cookies and any "sale" or "sharing" of PI
Financial incentive noticeRequired if offering loyalty program tied to data collection
Under-16 usersOpt-in required (no default setting of tracking cookies)

Brazil Configuration:

SettingValue
Banner typeConsent banner (opt-in recommended)
Default cookie stateNon-essential denied (conservative approach pending ANPD guidance)
Legal basis optionsConsent (Art. 7, I) or Legitimate Interest (Art. 7, IX)
Cookie policyMust be available in Portuguese
ANPD guidanceMonitor for specific cookie regulation (expected)
Data subject rightsAccess, correction, deletion, portability per LGPD

Consent State Storage by Jurisdiction

JurisdictionConsent Cookie NameContentDuration
EUpinnacle_consent_eu{version:"v3",analytics:false,advertising:false,functionality:false,timestamp:"2026-03-14T10:00:00Z"}6 months
UKpinnacle_consent_uk{version:"v3",analytics:false,advertising:false,functionality:false,timestamp:"2026-03-14T10:00:00Z"}12 months
US-CApinnacle_consent_ccpa{version:"v2",optout_sale:false,optout_sharing:false,gpc:false,timestamp:"2026-03-14T10:00:00Z"}12 months
Brazilpinnacle_consent_lgpd{version:"v2",analytics:false,advertising:false,timestamp:"2026-03-14T10:00:00Z"}12 months

Cross-Jurisdiction Cookie Policy

Policy Structure for Pinnacle E-Commerce Ltd

The cookie policy must address all jurisdictions served:

Section 1 — What Cookies We Use Universal section listing all cookies by category (same for all users).

Section 2 — Your Rights by Location

If You Are Located InYour Cookie Rights
European Economic AreaYou have the right to accept or reject non-essential cookies before they are set. We will not set analytics, advertising, or functionality cookies without your prior consent.
United KingdomUnder the Privacy and Electronic Communications Regulations (PECR), you have the right to accept or reject non-essential cookies before they are set.
California, USAYou have the right to opt out of the "sale" or "sharing" of your personal information collected through cookies. Click "Do Not Sell or Share My Personal Information" to exercise this right. We honor the Global Privacy Control (GPC) signal.
BrazilUnder the Lei Geral de Proteção de Dados (LGPD), we process cookie data based on your consent. You may withdraw consent at any time.
Other US StatesDepending on your state, you may have the right to opt out of targeted advertising. We honor universal opt-out mechanisms.

Section 3 — How to Manage Cookies Instructions for using the consent banner, browser settings, and GPC.

Section 4 — Updates to This Policy Version history and notification process for material changes.

Testing Cross-Jurisdiction Compliance

Verification Matrix

TestEUUKCaliforniaBrazil
Banner appears on first visitOpt-in bannerOpt-in bannerNotice with opt-out linkConsent banner
No non-essential cookies before interactionVerifyVerifyN/A (cookies allowed)Verify
Accept All sets all cookiesVerifyVerifyN/AVerify
Reject All blocks non-essentialVerifyVerifyN/AVerify
"Do Not Sell" link presentN/AN/AVerify in footerN/A
GPC signal honoredRecommendedRecommendedRequired — verifyRecommended
Consent persists across pagesVerifyVerifyVerifyVerify
Consent expires on schedule6 months12 months12 months12 months
Cookie policy accessibleVerifyVerifyVerifyVerify (Portuguese)

Key Legal References

  • ePrivacy Directive 2002/58/EC, Article 5(3) — EU cookie consent requirement
  • UK PECR (SI 2003/2426), Regulation 6 — UK cookie consent requirement
  • CCPA/CPRA (Cal. Civ. Code §1798.100 et seq.) — California opt-out model for sale/sharing
  • California AG Regulations, 11 CCR §7025 — GPC as valid opt-out mechanism
  • LGPD (Lei 13.709/2018), Articles 7-8 — Brazilian consent requirements
  • CJEU Case C-673/17 (Planet49) — Active consent; disclosure of duration and third-party access
  • TTDSG Section 25 — German implementation of ePrivacy cookie requirements
  • CNIL Deliberation No. 2020-091 — French cookie guidelines
  • UK ICO Guidance on Cookies and Similar Technologies (2023) — PECR compliance guidance
  • Colorado CPA Rules, 4 CCR 904-3, Rule 5.11 — Universal opt-out mechanism requirements

ePrivacy Directive Article 5(3) Essential Cookie Exemption

Overview

Article 5(3) of the ePrivacy Directive (2002/58/EC, as amended by Directive 2009/136/EC) requires informed consent before storing or accessing information on a user's terminal equipment (cookies, LocalStorage, device fingerprints). However, it provides an exemption for storage that is "strictly necessary in order for the provider of an information society service explicitly requested by the subscriber or user to deliver the service." Correctly classifying cookies under this exemption is critical — over-claiming exemption exposes organizations to enforcement action, while under-claiming creates unnecessary consent friction. The Article 29 Working Party Opinion 04/2012 on Cookie Consent Exemption (WP 194) remains the authoritative guidance on applying this exemption.

Exemption Criteria

The Two-Part Test

A cookie qualifies for the strictly necessary exemption only if BOTH conditions are met:

Condition 1 — The cookie is strictly necessary The cookie must be essential for the specific functionality that the user has actively requested. "Strictly necessary" means the service literally cannot function without it — not merely that it would be degraded or less convenient.

Condition 2 — For a service explicitly requested by the user The user must have actively requested the service that the cookie enables. The cookie must serve the user's purpose, not the website operator's purpose. A cookie that is necessary for the operator's business model (e.g., analytics) but not for the service the user requested (e.g., viewing products) does not qualify.

Article 29 Working Party Exemption Categories

WP 194 (Opinion 04/2012) identified specific cookie categories that can qualify for exemption:

Category A — User Input Cookies (Session-Only)

CriterionRequirement
PurposeKeeping track of user input during a multi-step process (e.g., filling a form, shopping cart)
DurationSession-only (deleted when browser closes) or short-lived (limited to a few hours)
ScopeFirst-party only
ExampleShopping cart contents during a browsing session

Pinnacle E-Commerce Ltd Examples:

CookiePurposeDurationExempt
cart_sessionStores items added to shopping cart during sessionSessionYes
checkout_stepTracks current step in multi-page checkoutSessionYes
form_data_tempPreserves form input if page reloads during checkout30 minutesYes

Category B — Authentication Cookies

CriterionRequirement
PurposeAuthenticating the user to provide access to authenticated content/services
DurationSession-only for session authentication; persistent only if user explicitly chose "remember me"
ScopeFirst-party only
ExampleSession token after login

Pinnacle E-Commerce Ltd Examples:

CookiePurposeDurationExempt
auth_tokenAuthenticates logged-in userSessionYes
refresh_tokenMaintains authentication across browser restarts (when "remember me" selected)30 daysYes — user explicitly requested persistent login
session_idLinks requests to server-side sessionSessionYes

Category C — User Security Cookies

CriterionRequirement
PurposeEnsuring security of the service explicitly requested by the user
DurationLimited to what is necessary
ScopeFirst-party only
ExampleCSRF protection, detecting repeated failed login attempts

Pinnacle E-Commerce Ltd Examples:

CookiePurposeDurationExempt
csrf_tokenPrevents cross-site request forgery attacksSessionYes
login_attemptsTracks failed login count for brute-force protection30 minutesYes
device_verifiedFlags device as verified after 2FA30 daysYes — security for authenticated service

Category D — Multimedia Player Session Cookies

CriterionRequirement
PurposeStoring technical data for media playback (quality settings, buffering)
DurationSession-only
ScopeFirst-party only
ExampleVideo player quality preference for current session

Category E — Load Balancing Cookies

CriterionRequirement
PurposeDistributing web traffic across multiple servers
DurationSession-only (persists only for the browsing session)
ScopeFirst-party only
ExampleLoad balancer session affinity cookie

Pinnacle E-Commerce Ltd Examples:

CookiePurposeDurationExempt
SERVERIDHAProxy server affinity cookieSessionYes
__cfduid (legacy)Cloudflare server identificationSessionYes — if session-only
lb_routeInternal load balancer routingSessionYes

Category F — UI Customisation Cookies (Session-Only)

CriterionRequirement
PurposeStoring user interface preferences explicitly set by the user during the session
DurationSession-only (first visit within a session); persistent requires consent
ScopeFirst-party only
ExampleLanguage selection within a session

Critical Distinction: A language preference cookie set for the current session when the user clicks a language selector is exempt. A persistent language preference cookie that remembers the selection across visits typically requires consent (it exceeds the session scope).

Pinnacle E-Commerce Ltd Examples:

CookiePurposeDurationExempt
locale_sessionLanguage selected during current sessionSessionYes
localePersistent language preference1 yearNo — requires consent
currency_sessionCurrency selected during current sessionSessionYes
currencyPersistent currency preference1 yearNo — requires consent

Non-Exempt Cookie Categories

The following cookie types are explicitly NOT exempt and always require consent:

Analytics and Performance Cookies

Cookie TypeWhy Not Exempt
Google Analytics (_ga, _gid)Serves the operator's analytics purpose, not the user's requested service
Hotjar (_hj*)Session recording and heatmaps serve the operator
A/B testing (optimizely_*)Experimentation serves the operator's optimization goals
Performance monitoringSite performance monitoring benefits the operator

Note: The CNIL has created a separate limited exemption for audience measurement (see analytics-cookie-consent skill), but this is a French-specific interpretation, not a universal ePrivacy Article 5(3) exemption.

Advertising and Targeting Cookies

Cookie TypeWhy Not Exempt
Meta Pixel (_fbp, _fbc)Advertising tracking serves the advertiser
Google Ads (_gcl_au, IDE)Conversion tracking and remarketing serve the advertiser
Retargeting cookiesCross-site tracking for ad personalization
Ad frequency cappingServes the ad delivery system, not the user

Social Media Plug-in Cookies

Cookie TypeWhy Not Exempt
Facebook Like button cookiesThird-party tracking via social widget
Twitter share widget cookiesThird-party data collection
YouTube embed cookiesGoogle tracking via embedded video
LinkedIn Insight TagProfessional network tracking

Exception: If a social login (e.g., "Login with Google") is explicitly requested by the user, the authentication cookies for that flow may qualify under Category B. The social platform's tracking cookies do not.

Persistent Preference Cookies

Cookie TypeWhy Not Exempt
Persistent language preferenceExceeds session scope
Theme/dark mode preference (persistent)Exceeds session scope
"Don't show again" dismissal cookiesConvenience, not strictly necessary
Recently viewed productsEnhancement, not essential service

Borderline Cases and Regulatory Guidance

Consent Cookie Itself

The cookie that stores whether the user has accepted or rejected cookies:

DPA PositionExempt?Reasoning
UK ICOYesStrictly necessary to remember the user's privacy choice
CNILYesTechnical necessity for implementing consent
Belgian DPAYesRequired to avoid re-prompting on every page
EDPBYes (implied)Necessary to fulfill the consent obligation

Pinnacle E-Commerce Ltd: The consent_state cookie is classified as strictly necessary.

Fraud Detection Cookies

ScenarioExempt?Reasoning
CSRF token for form submissionYesSecurity for service the user requested (submitting a form)
Bot detection (CAPTCHA)Likely yesSecurity for the service; some DPAs require notice
Device fingerprinting for fraudLikely noGoes beyond what is strictly necessary; may use consent or legitimate interest
reCAPTCHA cookiesContestedGoogle reCAPTCHA sets cookies and communicates with Google; some DPAs require consent

CDN and Infrastructure Cookies

ScenarioExempt?Reasoning
Cloudflare __cf_bm (bot management)ContestedSecurity-related but sets persistent cookie; review with DPO
CDN session routingYesLoad balancing (Category E)
Geographic routingYes if session-onlyInfrastructure necessity
A/B testing server routingNoOptimization, not user-requested service

Classification Process for Pinnacle E-Commerce Ltd

Step 1: Inventory All Cookies

Use the cookie-audit skill to generate a complete cookie inventory.

Step 2: Apply the Two-Part Test

For each cookie, answer:

  1. Is this cookie strictly necessary for the website to deliver a specific function?
  2. Did the user explicitly request that specific function?

Step 3: Classify and Document

CookieUser-Requested ServiceStrictly NecessaryDuration OKExempt
session_idBrowsing the siteYes — session stateSessionYes
auth_tokenLogging inYes — authenticationSessionYes
cart_sessionAdding items to cartYes — cart functionalitySessionYes
csrf_tokenSubmitting formsYes — form securitySessionYes
_gaNone (operator analytics)No2 yearsNo
_fbpNone (operator advertising)No90 daysNo
localeChanging languageDebatable1 yearNo — persistent, needs consent
consent_stateManaging cookie preferencesYes — consent management6 monthsYes

Step 4: Document Justification

For each exempt cookie, maintain a written justification:

Template:

Cookie: [name]
Classification: Strictly Necessary — Exempt from consent
User-Requested Service: [specific service]
Why Strictly Necessary: [explanation of why the service cannot function without this cookie]
Duration Justification: [why this duration is the minimum necessary]
WP 194 Category: [A/B/C/D/E/F]
Reviewed By: [DPO name]
Review Date: [date]
Next Review: [date + 12 months]

Key Legal References

  • ePrivacy Directive 2002/58/EC, Article 5(3) — Consent requirement and strictly necessary exemption
  • Directive 2009/136/EC (Citizens' Rights Directive) — Amended Article 5(3) to require informed consent
  • Article 29 Working Party Opinion 04/2012 (WP 194) — Authoritative guidance on cookie consent exemption categories
  • CJEU Case C-673/17 (Planet49) — Active consent; exemption applies only to strictly necessary cookies
  • EDPB Guidelines 05/2020 on Consent — Consent under GDPR applicable to ePrivacy consent
  • UK ICO Guidance on Cookies (2019, updated 2023) — PECR implementation of ePrivacy exemptions
  • CNIL Deliberation No. 2020-091 (17 September 2020) — French implementation of cookie exemptions
  • Recital 66, Directive 2009/136/EC — Exemption for cookies "strictly limited to the provision of an information society service explicitly requested"

Configuring Google Consent Mode v2

Overview

Google Consent Mode v2 is a framework that adjusts the behavior of Google tags (Analytics, Ads, Floodlight) based on user consent status. Announced in November 2023 with enforcement beginning March 2024, Consent Mode v2 introduces two new parameters — ad_user_data and ad_personalization — alongside the existing analytics_storage and ad_storage parameters. For advertisers serving users in the European Economic Area (EEA), implementing Consent Mode v2 is required to maintain measurement and audience capabilities in Google Ads and GA4. Without it, Google will not process EEA user data for remarketing lists or conversion measurement.

Consent Mode v2 Parameters

Parameter Definitions

ParameterControlsDefaultDescription
ad_storageAdvertising cookiesdeniedControls whether advertising-related cookies (gcl*, IDE) can be read/written
ad_user_dataUser data for advertisingdeniedControls whether user data can be sent to Google for advertising purposes
ad_personalizationAd personalizationdeniedControls whether data can be used for remarketing and personalized ads
analytics_storageAnalytics cookiesdeniedControls whether analytics cookies (_ga, _gid) can be read/written
functionality_storageFunctionality cookiesgrantedControls functionality cookies (language preferences)
personalization_storagePersonalization cookiesdeniedControls personalization cookies (recommendations)
security_storageSecurity cookiesgrantedControls security-related cookies (authentication, fraud prevention)

Consent State Mapping for Pinnacle E-Commerce Ltd

Map CMP consent categories to Consent Mode parameters:

CMP Categoryad_storagead_user_dataad_personalizationanalytics_storage
All rejected (default)denieddenieddenieddenied
Analytics onlydenieddenieddeniedgranted
Analytics + Advertisinggrantedgrantedgrantedgranted
Analytics + Advertising (no personalization)grantedgranteddeniedgranted
All acceptedgrantedgrantedgrantedgranted

Implementation

Basic Implementation (Google Tag / gtag.js)

Step 1: Set defaults before any Google tags load

Place this script in the <head> before the Google tag:

<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}

// Set default consent state — deny all non-essential before user interaction
gtag('consent', 'default', {
  'ad_storage': 'denied',
  'ad_user_data': 'denied',
  'ad_personalization': 'denied',
  'analytics_storage': 'denied',
  'functionality_storage': 'granted',
  'personalization_storage': 'denied',
  'security_storage': 'granted',
  'wait_for_update': 500  // Wait 500ms for CMP to load
});

// Enable URL passthrough for conversion measurement without cookies
gtag('set', 'url_passthrough', true);

// Enable ads data redaction when ad_storage is denied
gtag('set', 'ads_data_redaction', true);
</script>

Step 2: Load the Google tag

<script async src="https://www.googletagmanager.com/gtag/js?id=G-PINNACLE123"></script>
<script>
gtag('js', new Date());
gtag('config', 'G-PINNACLE123');
</script>

Step 3: Update consent state when user interacts with CMP

// Called by the CMP when user makes a consent choice
function updateGoogleConsent(consentState) {
  gtag('consent', 'update', {
    'ad_storage': consentState.advertising ? 'granted' : 'denied',
    'ad_user_data': consentState.advertising ? 'granted' : 'denied',
    'ad_personalization': consentState.personalization ? 'granted' : 'denied',
    'analytics_storage': consentState.analytics ? 'granted' : 'denied'
  });
}

Google Tag Manager Implementation

Step 1: Configure Consent Initialization trigger

In GTM, use the "Consent Initialization — All Pages" trigger type for the default consent tag. This fires before all other triggers.

Default Consent Tag (Consent Initialization trigger):

SettingValue
Tag typeGoogle tag: Consent configuration
ActionDefault
ad_storageDenied
ad_user_dataDenied
ad_personalizationDenied
analytics_storageDenied
Wait for update500 ms
URL passthroughEnabled
Ads data redactionEnabled

Step 2: Configure Consent Update tag

Create a custom HTML tag or use a CMP-specific template that fires on consent change:

Update Consent Tag (Custom Event trigger: consent_update):

SettingValue
Tag typeGoogle tag: Consent configuration
ActionUpdate
ad_storage{{CMP - Ad Storage Consent}}
ad_user_data{{CMP - Ad User Data Consent}}
ad_personalization{{CMP - Ad Personalization Consent}}
analytics_storage{{CMP - Analytics Storage Consent}}

Step 3: Configure tag consent settings

For each Google tag in GTM, configure the built-in consent checks:

TagRequired ConsentAdditional Consent
GA4 Configurationanalytics_storage—
GA4 Eventanalytics_storage—
Google Ads Conversionad_storagead_user_data
Google Ads Remarketingad_storagead_user_data, ad_personalization
Floodlight Counterad_storagead_user_data
Floodlight Salesad_storagead_user_data

Region-Specific Settings

Apply different defaults based on user geography:

// Strict defaults for EEA users
gtag('consent', 'default', {
  'ad_storage': 'denied',
  'ad_user_data': 'denied',
  'ad_personalization': 'denied',
  'analytics_storage': 'denied',
  'region': ['AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR',
             'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL',
             'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'IS', 'LI', 'NO']
});

// Less restrictive defaults for US users (adjust per state law)
gtag('consent', 'default', {
  'ad_storage': 'granted',
  'ad_user_data': 'granted',
  'ad_personalization': 'granted',
  'analytics_storage': 'granted',
  'region': ['US']
});

Conversion Modeling and Cookieless Pings

How Consent Mode Preserves Measurement

When consent is denied, Google tags still send cookieless pings that include:

  • Page URL (with ads_data_redaction applied)
  • Timestamp
  • User agent
  • Referrer (if ads_data_redaction is false)
  • Aggregate consent state

Google uses these pings, combined with data from consenting users, to build machine learning models that estimate:

  • Conversion modeling: Estimated conversions from users who did not consent to ad_storage
  • Behavioral modeling in GA4: Estimated user counts and session metrics for non-consenting users

Conversion Modeling Requirements

For Google to generate modeled conversions, Pinnacle E-Commerce Ltd must meet:

RequirementThreshold
Minimum consented conversions per day70+ per conversion action
Minimum total conversions per day100+ per conversion action
Consent Mode implemented forAt least 7 consecutive days
Tag coverageAll conversion-relevant pages

GA4 Behavioral Modeling

GA4 behavioral modeling fills gaps in analytics data:

RequirementThreshold
Minimum daily consented users1,000+ per property
Minimum days of data7+ consecutive days
Consent Mode coverageAll GA4 pageview and event tags

Verification and Debugging

Google Tag Assistant Verification

Use Google Tag Assistant (browser extension) to verify:

  1. Default consent fires before tags: Check that consent defaults appear before the Google tag configuration in the Tag Assistant timeline
  2. Update consent fires on CMP interaction: Verify consent update events appear when the user interacts with the cookie banner
  3. Tag behavior matches consent state: Confirm that GA4 and Ads tags fire (or are blocked) based on consent

Real-Time Debugging

In GA4 DebugView, consent-impacted events display with:

  • A "consent" badge showing current consent state
  • Missing user/session IDs when analytics_storage is denied
  • Cookieless ping indicators

Network-Level Verification

Monitor network requests to https://www.google-analytics.com/g/collect:

ParameterConsent GrantedConsent Denied
_p (Page ID)PresentPresent
cid (Client ID)From _ga cookieRandomly generated per-hit
gcs (Consent State)G111 (all granted)G100 (all denied)
gcd (Consent Default)PresentPresent
Cookie set_ga, _gidNone

EEA Requirements (March 2024)

Google's Digital Markets Act (DMA) compliance requirements:

  1. Consent Mode v2 mandatory: All advertisers targeting EEA users must implement Consent Mode v2 to maintain remarketing lists and conversion measurement
  2. ad_user_data and ad_personalization required: The two new v2 parameters must be set; omitting them is treated as "denied"
  3. Verified CMP recommended: Google recommends using a Google-certified CMP partner for EU consent collection
  4. Enhanced Conversions with consent: Enhanced Conversions (first-party data matching) requires ad_user_data = granted

Key References

  • Google Consent Mode v2 Documentation — Official implementation guide
  • Google Tag Manager Consent Configuration — GTM-specific setup instructions
  • Google Ads DMA Compliance Guide (March 2024) — EEA-specific requirements
  • EU Digital Markets Act (DMA) Regulation 2022/1925 — Legal basis for Google's consent requirements
  • ePrivacy Directive 2002/58/EC, Article 5(3) — Cookie consent legal basis
  • CJEU Case C-673/17 (Planet49) — Active consent requirements applicable to consent mode default states

Global Privacy Control Integration with Cookie Consent

Overview

Global Privacy Control (GPC) is a browser-level signal that communicates a user's privacy preferences to websites. Specified by the GPC community group and recognized as a legally binding opt-out mechanism under California's CCPA/CPRA (effective January 1, 2023), Colorado's CPA (effective July 1, 2024), Connecticut's CTDPA (effective July 1, 2023), and other US state privacy laws, GPC transmits a Sec-GPC: 1 HTTP header and a navigator.globalPrivacyControl JavaScript property with each request. Websites must detect this signal and automatically trigger opt-out of sale, sharing, and targeted advertising without requiring additional user action. Integration with cookie consent management platforms (CMPs) is essential to ensure the GPC signal correctly suppresses advertising cookies and data sharing.

GPC Signal Specification

How GPC Works

HTTP Header:

Sec-GPC: 1

Present on every HTTP request when the user has enabled GPC in their browser or browser extension.

JavaScript API:

navigator.globalPrivacyControl  // Returns true if GPC is enabled

GPC-Enabled Browsers and Extensions:

Browser/ExtensionGPC SupportHow to Enable
FirefoxBuilt-in (v120+)Settings > Privacy & Security > "Tell websites not to sell or share my data"
BraveBuilt-in (default ON)Enabled by default; disable in Settings > Shields
DuckDuckGo BrowserBuilt-in (default ON)Enabled by default on mobile and desktop
DuckDuckGo ExtensionExtensionInstall extension; GPC enabled by default
Privacy Badger (EFF)ExtensionInstall extension; GPC enabled by default
OptMeowtExtensionChrome/Firefox extension specifically for GPC
SafariNot natively supportedRequires third-party extension
ChromeNot natively supportedRequires extension (DuckDuckGo, Privacy Badger)

GPC vs. Do Not Track (DNT)

FeatureGPCDNT
HTTP headerSec-GPC: 1DNT: 1
JavaScript APInavigator.globalPrivacyControlnavigator.doNotTrack
Legal recognitionYes — CCPA/CPRA, CPA, CTDPA, other state lawsNo legal enforcement mechanism
ScopeOpt-out of sale, sharing, targeted advertisingGeneral tracking preference
Browser adoptionGrowing (Firefox, Brave, DuckDuckGo)Deprecated by most browsers
Industry complianceLegally required in applicable jurisdictionsLargely ignored

US State Law Mapping

GPC Legal Requirements by State

StateLawGPC StatusEffective DateRequirement
CaliforniaCCPA/CPRALegally binding opt-outJan 1, 2023Must treat GPC as valid opt-out of sale and sharing (Cal. Civ. Code §1798.135(e); 11 CCR §7025(b))
ColoradoCPALegally binding opt-outJul 1, 2024Must honor "universal opt-out mechanism" including GPC (C.R.S. §6-1-1313(1)(a); 4 CCR 904-3 Rule 5.11)
ConnecticutCTDPALegally binding opt-outJul 1, 2023 (UOM: Jan 1, 2025)Must honor "opt-out preference signal" (P.A. 22-15, §6(a)(6))
MontanaMCDPALegally binding opt-outOct 1, 2024Must honor universal opt-out mechanism
TexasTDPSALegally binding opt-outJul 1, 2024 (UOM: Jan 1, 2025)Must honor universal opt-out mechanism
OregonOCPALegally binding opt-outJul 1, 2024 (UOM: Jan 1, 2026)Must honor universal opt-out mechanism
DelawareDPDPALegally binding opt-outJan 1, 2025 (UOM: Jan 1, 2026)Must honor universal opt-out mechanism
New HampshireNHPALegally binding opt-outJan 1, 2025Must honor universal opt-out mechanism
New JerseyNJDPALegally binding opt-outJan 15, 2025 (UOM: Jul 15, 2025)Must honor universal opt-out mechanism
VirginiaVCDPAVoluntary (no UOM mandate)Jan 1, 2023No explicit UOM requirement, but opt-out of targeted advertising required
UtahUCPAVoluntary (no UOM mandate)Dec 31, 2023No UOM requirement

What GPC Triggers

When GPC is detected for a user in an applicable jurisdiction:

Processing ActivityGPC ImpactAction Required
Sale of personal informationOpt-out triggeredStop selling PI for this user
Sharing for cross-context behavioral advertisingOpt-out triggeredStop sharing PI with ad partners
Targeted advertisingOpt-out triggered (CPA, CTDPA, TDPSA)Disable behavioral targeting
Profiling for automated decisionsOpt-out triggered (some states)Disable profiling
Analytics (first-party)Not triggeredGPC does not opt out of first-party analytics
Essential cookiesNot triggeredStrictly necessary cookies unaffected

CMP Integration

Detection and Response Flow

Page Load
    │
    ├── Check for GPC signal
    │   ├── navigator.globalPrivacyControl === true
    │   │   OR
    │   └── Server detects Sec-GPC: 1 header
    │
    ├── Determine user jurisdiction
    │   ├── IP geolocation → US state mapping
    │   └── Check if state has GPC legal requirement
    │
    ├── If GPC detected AND applicable jurisdiction:
    │   ├── Automatically set consent state:
    │   │   ├── ad_storage: denied
    │   │   ├── ad_user_data: denied
    │   │   ├── ad_personalization: denied
    │   │   ├── analytics_storage: [per CMP default — GPC does not cover]
    │   │   └── sale_of_data: opted_out
    │   │
    │   ├── Block advertising cookies and tags
    │   ├── Do NOT fire: Meta Pixel, Google Ads remarketing, third-party ad tags
    │   ├── DO fire: GA4 (if analytics consent separate from GPC)
    │   │
    │   ├── Display modified banner (optional):
    │   │   "We detected your Global Privacy Control preference.
    │   │    We will not sell or share your personal information.
    │   │    [Manage Other Preferences]"
    │   │
    │   └── Record GPC opt-out in consent log
    │
    └── If GPC detected but NON-applicable jurisdiction (e.g., EU):
        └── Treat as privacy signal but apply jurisdiction's own rules
            (EU still requires opt-in consent regardless of GPC)

Implementation for Pinnacle E-Commerce Ltd

Server-Side GPC Detection (Node.js middleware):

function detectGPC(req, res, next) {
  const gpcHeader = req.headers['sec-gpc'];
  const gpcEnabled = gpcHeader === '1';

  req.gpcSignal = gpcEnabled;

  if (gpcEnabled) {
    // Determine jurisdiction from IP
    const userState = geolocateToState(req.ip);

    // States where GPC is legally binding
    const gpcMandatoryStates = ['CA', 'CO', 'CT', 'MT', 'TX', 'OR', 'DE', 'NH', 'NJ'];

    req.gpcLegallyBinding = gpcMandatoryStates.includes(userState);
    req.gpcOptOut = {
      sale: gpcEnabled && req.gpcLegallyBinding,
      sharing: gpcEnabled && req.gpcLegallyBinding,
      targetedAdvertising: gpcEnabled && req.gpcLegallyBinding,
    };
  }

  next();
}

Client-Side GPC Detection and CMP Update:

function handleGPCSignal() {
  const gpcEnabled = navigator.globalPrivacyControl === true;

  if (!gpcEnabled) return;

  // Get user's jurisdiction (from server or geolocation)
  const userJurisdiction = getUserJurisdiction();
  const gpcBindingStates = ['CA', 'CO', 'CT', 'MT', 'TX', 'OR', 'DE', 'NH', 'NJ'];

  if (gpcBindingStates.includes(userJurisdiction)) {
    // Update Google Consent Mode
    gtag('consent', 'update', {
      'ad_storage': 'denied',
      'ad_user_data': 'denied',
      'ad_personalization': 'denied',
      // analytics_storage not affected by GPC
    });

    // Update CMP state
    updateCMPState({
      sale_optout: true,
      sharing_optout: true,
      targeted_advertising_optout: true,
      source: 'gpc_signal',
    });

    // Remove any existing advertising cookies
    removeAdvertisingCookies();

    // Log GPC opt-out
    logConsentEvent({
      type: 'gpc_auto_optout',
      jurisdiction: userJurisdiction,
      timestamp: new Date().toISOString(),
      gpc_header_present: true,
    });
  }
}

function removeAdvertisingCookies() {
  const adCookies = ['_fbp', '_fbc', '_gcl_au', 'IDE', 'fr', 'NID'];
  adCookies.forEach(name => {
    document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=.pinnacle-ecommerce.com`;
  });
}

// Run on page load
handleGPCSignal();

CMP Platform Integration

OneTrust GPC Configuration:

SettingValue
Honor GPC SignalEnabled
GPC TreatmentApply to "Sale of Personal Data" and "Targeted Advertising" categories
GPC Applicable RegionsUS-CA, US-CO, US-CT, US-MT, US-TX, US-OR, US-DE, US-NH, US-NJ
GPC Banner BehaviorSuppress opt-out banner (already opted out); show confirmation notice
GPC Consent RecordLog GPC signal as opt-out source

Cookiebot GPC Configuration:

SettingValue
Respect GPCEnabled
GPC → Category MappingGPC = reject "Marketing" category
GPC RegionsCalifornia, Colorado, Connecticut, Montana, Texas, Oregon, Delaware, New Hampshire, New Jersey

GPC Verification and Compliance

Testing GPC Integration

TestExpected BehaviorVerification Method
GPC header sentBrowser sends Sec-GPC: 1Network inspector
Server detects GPCMiddleware sets req.gpcSignal = trueServer logs
Ad cookies blockedNo _fbp, _gcl_au, IDE cookies setCookie inspector
Ad tags blockedNo Meta Pixel, Google Ads remarketing requestsNetwork inspector
Analytics unaffectedGA4 still fires (GPC does not cover analytics)GA4 real-time reports
Consent log records GPCGPC opt-out logged with timestamp and jurisdictionDatabase query
CCPA opt-out link reflects GPC"Do Not Sell" page shows GPC-detected opt-out statusUI inspection
Modified banner displayedBanner acknowledges GPC preferenceVisual verification

CCPA/CPRA Specific Requirements

Under California Attorney General regulations (11 CCR §7025):

  1. No degradation of service: A business must not interpret GPC as consent to financial incentive opt-in
  2. Conflict resolution: If a user has previously opted in to sale/sharing, GPC on a subsequent visit should be treated as a revocation of that opt-in
  3. No re-prompting: Do not ask a GPC user to reconsider their opt-out choice
  4. Record keeping: Maintain records of GPC-triggered opt-outs for 24 months
  5. Privacy policy disclosure: State in the privacy policy that the business honors GPC

Pinnacle E-Commerce Ltd Privacy Policy Language:

"We recognize the Global Privacy Control (GPC) signal sent by your browser. When we detect a GPC signal from a user in California, we treat it as a request to opt out of the sale and sharing of personal information as defined under the California Consumer Privacy Act (CCPA) and California Privacy Rights Act (CPRA). We apply this opt-out automatically without requiring any additional action from you."

Edge Cases

ScenarioResolution
User has GPC enabled but previously opted IN to sharingGPC overrides — treat as opt-out (most recent signal governs)
User has GPC enabled and is in non-applicable state (e.g., Utah)Respect GPC as privacy preference but not legally required
User has GPC enabled and is in EUGPC does not substitute for opt-in consent; apply EU rules
GPC detected on API request (no browser)Honor if Sec-GPC header present (may be from privacy-aware app)
GPC enabled for some pages, disabled for othersPer-request evaluation; this should not normally occur
Multiple opt-out signals (GPC + cookie banner reject)Apply most restrictive — both result in opt-out

Key Legal and Technical References

  • GPC Specification (globalprivacycontrol.org) — Technical specification for the GPC signal
  • CCPA/CPRA Cal. Civ. Code §1798.135(e) — Business must treat GPC as valid opt-out request
  • 11 CCR §7025(b)-(c) (California AG Regulations) — GPC implementation requirements
  • Colorado CPA Rules, 4 CCR 904-3, Rule 5.11 — Universal opt-out mechanism requirements including GPC
  • Connecticut CTDPA P.A. 22-15, §6(a)(6) — Opt-out preference signal requirement
  • California AG Enforcement Action: Sephora (August 2022) — First CCPA enforcement for failure to honor GPC; $1.2 million settlement
  • EDPB Statement on GPC (2023) — European perspective on GPC as an expression of Article 21 objection right
  • W3C Privacy Community Group — GPC specification development
  • IAB CCPA Compliance Framework — US Privacy String and GPC interoperability

Server-Side Tracking with Privacy Controls

Overview

Server-side tracking moves data collection from the user's browser to a server-controlled environment, providing greater control over what data is shared with third parties. Instead of loading third-party JavaScript directly in the browser (which sets third-party cookies and sends data to external servers without intermediation), a server-side container receives events from the client, processes them, and selectively forwards data to analytics and advertising endpoints. This architecture enables IP anonymization before data leaves the first-party infrastructure, consent-based routing of events, and reduced reliance on third-party cookies — directly supporting ePrivacy Directive Article 5(3) compliance and data minimization under GDPR Article 5(1)(c).

Architecture

Client-Server Flow

User's Browser
    │
    ├── Client-side GTM container (minimal)
    │   └── Sends events to first-party endpoint
    │
    ▼
First-Party Server Endpoint
(https://data.pinnacle-ecommerce.com)
    │
    ├── Server-side GTM container
    │   ├── Validates consent state
    │   ├── Anonymizes IP address
    │   ├── Strips unnecessary identifiers
    │   ├── Applies data minimization rules
    │   │
    │   ├── [If analytics consent granted]
    │   │   └── Forward to Google Analytics 4
    │   │
    │   ├── [If advertising consent granted]
    │   │   ├── Forward to Google Ads
    │   │   ├── Forward to Meta Conversions API
    │   │   └── Forward to other ad platforms
    │   │
    │   └── [If all consent denied]
    │       └── Log aggregate pageview count only (no PII)
    │
    └── First-party server logs (retention: 90 days)

Infrastructure Setup for Pinnacle E-Commerce Ltd

Server Container Hosting Options:

OptionProviderMonthly Cost (est.)LatencyControl
Google Cloud RunGoogle CloudEUR 50-200LowHigh
AWS App RunnerAmazon Web ServicesEUR 40-180LowHigh
Custom DockerSelf-hostedEUR 30-150VariesMaximum
Stape.ioManaged serviceEUR 20-100LowMedium

Pinnacle E-Commerce Ltd Configuration:

SettingValue
Server container URLhttps://data.pinnacle-ecommerce.com
Custom domaindata.pinnacle-ecommerce.com (CNAME to container)
Container regioneurope-west1 (Belgium) — co-located with EU users
ScalingMin 1 instance, max 10 instances
SSL certificateLet's Encrypt via managed certificate
First-party cookie domain.pinnacle-ecommerce.com

Custom Domain for First-Party Context

Using a subdomain of the main site domain ensures:

  • Cookies set by the server container are first-party cookies
  • Requests to data.pinnacle-ecommerce.com are same-site, avoiding third-party cookie restrictions
  • Safari ITP and Firefox ETP do not apply cross-site tracking protections

DNS Configuration:

data.pinnacle-ecommerce.com  CNAME  server-container-abc123.run.app

Consent-Aware Event Forwarding

Consent Validation on the Server

Every event arriving at the server container includes the consent state from the client. The server validates this before forwarding:

Event Payload from Client:

{
  "client_id": "1234567890.1709000000",
  "event_name": "purchase",
  "event_params": {
    "transaction_id": "TXN-2026-0314-001",
    "value": 149.99,
    "currency": "EUR",
    "items": [{"item_id": "SKU-001", "item_name": "Widget Pro"}]
  },
  "consent_state": {
    "analytics_storage": "granted",
    "ad_storage": "denied",
    "ad_user_data": "denied",
    "ad_personalization": "denied"
  },
  "user_agent": "Mozilla/5.0...",
  "ip_address": "203.0.113.42"
}

Server-Side Routing Logic:

DestinationRequired ConsentData Sent
GA4 Measurement Protocolanalytics_storage: grantedEvent name, params, anonymized client_id
Google Ads Conversion APIad_storage + ad_user_data: grantedConversion data, gclid, hashed email
Meta Conversions APIad_storage + ad_user_data: grantedEvent data, fbp, hashed email/phone
Aggregate counter (internal)None required+1 to event type counter (no PII)

IP Anonymization

The server container anonymizes IP addresses before forwarding to any third party:

Anonymization Rules:

MethodDescriptionUse Case
IPv4 last octet zeroing203.0.113.42 → 203.0.113.0Standard GA4 anonymization
IPv6 last 80 bits zeroing2001:db8::1234:5678 → 2001:db8::IPv6 anonymization
Full IP removalIP not forwarded at allMaximum privacy (Meta CAPI)
Geolocation-onlyResolve to country/region, discard IPGeo reporting without IP

Pinnacle E-Commerce Ltd Policy:

  • GA4: Forward anonymized IP (last octet zeroed) for geographic reporting
  • Google Ads: Forward anonymized IP for conversion geo-attribution
  • Meta CAPI: Do not forward IP; send hashed email only (with ad_user_data consent)
  • Internal logs: Retain full IP for 24 hours for security/fraud detection, then anonymize

Data Minimization at the Server Layer

The server container strips data before forwarding:

Data ElementRetained for GA4Retained for AdsRetained Internally
Full URLPath only (no query params)Path onlyFull URL (90 days)
User agentReduced UA (SEC-CH-UA)Reduced UAFull UA (24 hours)
IP addressAnonymizedAnonymizedFull (24 hours)
ReferrerDomain onlyDomain onlyFull (90 days)
Client IDGA client_idgclid/wbraid onlyInternal session ID
Email (hashed)Not sentSHA-256 hashNot stored

Server-Side Tag Configurations

GA4 Server-Side Tag

SettingValue
Measurement IDG-PINNACLE123
API SecretStored in Secret Manager
Send toGA4 Measurement Protocol
IP anonymizationEnabled (default in GA4)
Client ID sourceFirst-party _ga cookie
Session ID sourceFirst-party ga* cookie

Meta Conversions API Tag

SettingValue
Pixel ID123456789012345
Access TokenStored in Secret Manager
Event deduplicationevent_id matches browser Pixel event_id
Data sentEvent name, event_time, action_source, hashed email
IP forwardingDisabled
User agent forwardingReduced UA only

First-Party Cookie Management

The server container can set first-party cookies via Set-Cookie headers, giving them longer lifetimes than client-side JavaScript cookies (which Safari ITP caps at 7 days):

CookieSet ByDurationPurpose
_gaServer (Set-Cookie header)2 yearsGA4 client identifier
_ga_PINNACLEServer (Set-Cookie header)2 yearsGA4 session persistence
_fbcServer (Set-Cookie header)90 daysMeta click identifier
_pin_sessServer (Set-Cookie header)30 minutesInternal session tracking

All cookies above are set only when the corresponding consent category is granted.

Monitoring and Debugging

Server Container Health Checks

MetricTargetAlert Threshold
Request latency (p99)< 200ms> 500ms
Error rate< 0.1%> 1%
Event throughputBaseline +/- 20%> 30% deviation
Consent validation failures0> 0
Forwarding failures (GA4)< 0.5%> 2%
Forwarding failures (Meta)< 1%> 5%

Data Flow Audit

Monthly audit of server-side tracking:

  1. Compare client-side events sent vs. server-side events received (expect < 2% loss)
  2. Verify consent state is correctly parsed for all forwarded events
  3. Confirm no PII is forwarded to destinations where consent is denied
  4. Check that IP anonymization is applied before all third-party forwarding
  5. Validate first-party cookie durations match policy
  6. Review server logs for any unexpected outbound connections

Key Legal and Technical References

  • ePrivacy Directive 2002/58/EC, Article 5(3) — Consent for device storage/access; server-side cookies still require consent if non-essential
  • GDPR Article 5(1)(c) — Data minimization principle; server-side filtering reduces data shared with third parties
  • GDPR Article 28 — Data processor requirements for server hosting providers
  • GDPR Article 44-49 — Transfer restrictions if server container is outside EEA
  • Google Tag Manager Server-Side Documentation — Container setup and tag configuration
  • Meta Conversions API Documentation — Server-side event forwarding for Meta advertising
  • Safari Intelligent Tracking Prevention (ITP) — Client-side cookie limitations driving server-side adoption
  • CNIL Deliberation No. 2020-091 — Server-set cookies still subject to consent requirements

IAB TCF v2.2 Implementation

Overview

The IAB Europe Transparency and Consent Framework (TCF) v2.2, released in May 2023 as an update to v2.0, provides a standardized mechanism for collecting, encoding, and distributing user consent signals across the programmatic advertising supply chain. Publishers, advertisers, and ad technology vendors use TCF to communicate consent status through the TC String — a compact, base64url-encoded data structure. TCF v2.2 introduced key changes including the removal of legitimate interest as a legal basis for cross-device targeting (Purpose 2 in part) and restrictions on certain vendor practices.

TCF v2.2 Architecture

Core Components

  1. Consent Management Platform (CMP): The user-facing interface that collects consent. Must be registered with IAB Europe and assigned a CMP ID.
  2. Global Vendor List (GVL): A centralized registry of ad technology vendors, maintained by IAB Europe, listing each vendor's declared purposes and legal bases.
  3. TC String: The encoded consent signal transmitted through the ad supply chain.
  4. CMP API (__tcfapi): A JavaScript API that vendors call to read the current consent state.

Implementation for Pinnacle E-Commerce Ltd

Step 1: CMP Registration

Register Pinnacle E-Commerce Ltd's CMP with IAB Europe:

Registration FieldValue
CMP NamePinnacle Consent Manager
PublisherPinnacle E-Commerce Ltd
CMP IDAssigned by IAB Europe upon registration (e.g., 432)
Supported TCF version2.2
GVL versionLatest (auto-updated weekly)
CMP JavaScript URLhttps://cmp.pinnacle-ecommerce.com/tcf-v2.js

Registration requirements:

  • Demonstrate CMP compliance with IAB TCF Policies
  • Pass IAB Europe CMP validation testing
  • Agree to the CMP Terms and Conditions
  • Implement the __tcfapi stub before the full CMP loads
Step 2: Global Vendor List Integration

The GVL is published at https://vendor-list.consensu.org/v3/vendor-list.json and contains:

{
  "gvlSpecificationVersion": 3,
  "vendorListVersion": 287,
  "tcfPolicyVersion": 4,
  "lastUpdated": "2026-03-01T12:00:00Z",
  "purposes": {
    "1": {
      "id": 1,
      "name": "Store and/or access information on a device",
      "description": "Cookies, device or similar online identifiers...",
      "illustrations": ["..."]
    }
  },
  "vendors": {
    "755": {
      "id": 755,
      "name": "Google Advertising Products",
      "purposes": [1, 3, 4],
      "legIntPurposes": [2, 7, 9, 10],
      "flexiblePurposes": [2, 7, 9, 10],
      "specialPurposes": [1, 2],
      "features": [1, 2],
      "specialFeatures": [],
      "policyUrl": "https://policies.google.com/privacy",
      "cookieMaxAgeSeconds": 63072000,
      "usesCookies": true,
      "usesNonCookieAccess": true
    }
  }
}

GVL Management for Pinnacle E-Commerce Ltd:

  1. Cache the GVL locally with a maximum staleness of 24 hours
  2. Display only vendors that Pinnacle E-Commerce Ltd actually uses (vendor subset)
  3. Show vendor count in the consent banner: "We work with 47 advertising partners"
  4. Provide a searchable vendor list in the detailed consent layer

Pinnacle E-Commerce Ltd Vendor Subset:

Vendor IDVendor NamePurposesLegal Basis
755Google Advertising Products1, 3, 4Consent
91Criteo SA1, 2, 3, 4, 7Consent
42Taboola Inc.1, 2, 3, 4, 5, 7Consent
69OpenX Technologies1, 2, 3, 4, 7Consent
253Meta Platforms, Inc.1, 2, 3, 4, 7, 10Consent
Step 3: TCF v2.2 Purposes

The 11 TCF purposes and their mapping for Pinnacle E-Commerce Ltd:

TCF PurposeNameLegal Basis at Pinnacle
1Store and/or access information on a deviceConsent only
2Select basic adsConsent only
3Create profiles for personalised advertisingConsent only
4Use profiles to select personalised adsConsent only
5Create profiles to personalise contentConsent only
6Use profiles to select personalised contentConsent only
7Measure ad performanceConsent only
8Measure content performanceConsent only
9Understand audiences through statistics or combinations of data from different sourcesConsent only
10Develop and improve servicesConsent only
11Use limited data to select contentConsent only

Special Purposes (always allowed, no consent required):

  • SP1: Ensure security, prevent and detect fraud, and fix errors
  • SP2: Deliver and present advertising and content

Features (declared, not consented to individually):

  • F1: Match and combine data from other data sources
  • F2: Link different devices
  • F3: Receive and use automatically-sent device characteristics for identification

Special Features (require explicit consent):

  • SF1: Use precise geolocation data
  • SF2: Actively scan device characteristics for identification
Step 4: TC String Structure

The TC String is a base64url-encoded binary string containing:

Core String Segments:

FieldBitsDescription
Version6TCF version (value: 2)
Created36Deciseconds since 01/01/2020 00:00:00 UTC
LastUpdated36Deciseconds since 01/01/2020 00:00:00 UTC
CmpId12CMP ID (Pinnacle: 432)
CmpVersion12CMP version number
ConsentScreen6Screen number in CMP where consent was given
ConsentLanguage12ISO 639-1 language code
VendorListVersion12GVL version used
TcfPolicyVersion6TCF Policy version (value: 4)
IsServiceSpecific11 = publisher-specific TC String
UseNonStandardStacks1Whether non-IAB standard stacks are used
PurposeConsents24Bitfield for purpose consent (purposes 1-24)
PurposeLegitimateInterests24Bitfield for purpose LI
PurposeOneTreatment10 = purpose 1 was disclosed; 1 = not
PublisherCC12ISO 3166-1 alpha-2 publisher country code

Vendor Consent Section: Variable-length encoding of per-vendor consent using either a bitfield or range encoding, depending on which is more compact.

Publisher Restrictions Section: Overrides vendor-declared legal bases at the publisher level.

Step 5: Publisher Restrictions

Pinnacle E-Commerce Ltd applies publisher restrictions to enforce consent-only for all purposes:

{
  "publisherRestrictions": [
    {
      "purposeId": 2,
      "restrictionType": 1,
      "vendorIds": [91, 42, 69]
    },
    {
      "purposeId": 7,
      "restrictionType": 1,
      "vendorIds": [91, 42, 69, 253]
    },
    {
      "purposeId": 9,
      "restrictionType": 1,
      "vendorIds": [91, 42, 69]
    },
    {
      "purposeId": 10,
      "restrictionType": 1,
      "vendorIds": [91, 42, 69, 253]
    }
  ]
}

Restriction types:

  • 0 = Purpose flatly not allowed by publisher
  • 1 = Require consent (override legitimate interest)
  • 2 = Require legitimate interest (override consent)
  • 3 = Vendor requires both consent and LI to process
Step 6: CMP API Implementation

The __tcfapi must be available before any vendor scripts load:

Stub Implementation (loads first):

(function() {
  var queue = [];
  var tcfapi = function(command, version, callback, parameter) {
    if (command === 'addEventListener') {
      queue.push({ command: command, callback: callback });
    } else {
      queue.push({ command: command, version: version, callback: callback, parameter: parameter });
    }
  };
  tcfapi.queue = queue;
  window.__tcfapi = tcfapi;
})();

Supported Commands:

CommandDescription
getTCDataReturns the TC String and parsed consent data
pingReturns CMP status and loading state
addEventListenerRegisters a callback for consent changes
removeEventListenerRemoves a registered callback
getInAppTCDataReturns TC data for in-app (mobile) contexts

getTCData Response:

{
  "tcString": "CPyXXYAPyXXYAAGABCENB4CgAP_AAH_AAAAAHfoBpDxkBSFCAGJoYtkgAAAGxwAAICACABAAoAAAABoAIAQAAAAQAAAgBAAAABIAIAIAAABAGEAAAAAAQAAAAQAAAEAAAAAAIQIAAAAAAiBAAAAAAAAAAAAAAABAAAAAAAAAAgAAAAAAAQAA",
  "tcfPolicyVersion": 4,
  "cmpId": 432,
  "cmpVersion": 1,
  "gdprApplies": true,
  "eventStatus": "useractioncomplete",
  "purpose": {
    "consents": { "1": true, "2": false, "3": false, "4": false, "7": true },
    "legitimateInterests": {}
  },
  "vendor": {
    "consents": { "755": true, "91": false, "42": false },
    "legitimateInterests": {}
  },
  "publisher": {
    "restrictions": { "2": { "91": 1, "42": 1, "69": 1 } }
  }
}

TCF v2.2 Compliance Validation

Validation Checklist

RequirementVerification Method
CMP registered with IAB EuropeCheck CMP ID in IAB registry
GVL version current (within 7 days)Parse TC String VendorListVersion field
TC String decodes correctlyUse IAB reference decoder
Purpose 1 consent collected before device storageVerify no cookies set pre-consent
Publisher restrictions encodedDecode TC String restrictions segment
__tcfapi responds to pingCall __tcfapi('ping', 2, callback)
Consent UI shows all declared purposesCompare UI with GVL purposes
Vendor list matches GVL subsetCompare displayed vendors with GVL
TC String transmitted in bid requestsInspect OpenRTB consent field

Key Legal and Technical References

  • IAB Europe TCF v2.2 Technical Specification (May 2023) — TC String format, CMP API, GVL structure
  • IAB Europe TCF Policies v4 — Rules governing CMPs and vendors
  • IAB Europe CMP Validator Tool — Automated TC String validation
  • ePrivacy Directive 2002/58/EC, Article 5(3) — Legal basis for TCF Purpose 1
  • CJEU Case C-673/17 (Planet49) — Active consent requirements
  • Belgian DPA Decision 21/2022 (IAB Europe) — Found IAB Europe a data controller for TC String; TCF must ensure valid GDPR consent
  • GDPR Article 4(11) — Consent definition applicable to TCF consent signals

Sponsors

Details

Marketplace
mukul975/Privacy-Data-Protection-Skills
Source
plugins/cookie-consent-skills
Author
Mahipal
Category
Compliance
License
Apache-2.0
Keywords
cookies, tcf, cnil, cookie-consent, gpc

More from mukul975/Privacy-Data-Protection-Skills

All 21