Third-Party Cookie Deprecation | Blue Frog Docs

Third-Party Cookie Deprecation

Understanding and adapting to Chrome's third-party cookie sunset and its impact on tracking

Third-Party Cookie Deprecation

What This Means

Third-party cookies are being phased out across major browsers. Chrome, the last major browser to support them, is gradually deprecating third-party cookies as part of the Privacy Sandbox initiative.

Impact on Tracking:

  • Cross-site tracking becomes significantly limited
  • Remarketing audiences become less precise
  • Attribution windows shorten
  • Conversion tracking accuracy decreases
  • Cross-device tracking becomes more difficult

Timeline:

  • Safari/Firefox: Already block third-party cookies by default
  • Chrome: Gradual rollout of restrictions beginning 2024
  • Enterprise deadline: Full deprecation expected by late 2024/2025

How to Diagnose

// Test if third-party cookies are available
function checkThirdPartyCookies() {
  const testCookie = 'test_3p_cookie';

  // Create an iframe to a different domain
  const iframe = document.createElement('iframe');
  iframe.src = 'https://different-domain.com/cookie-test';
  iframe.style.display = 'none';

  document.body.appendChild(iframe);

  // Check if cookies were set
  setTimeout(() => {
    const cookies = document.cookie;
    console.log('Third-party cookies supported:', cookies.includes(testCookie));
  }, 1000);
}

Check which tags rely on third-party cookies:

Platform Cookie Name Impact
Google Ads IDE, DSID Remarketing, conversions
Meta _fbp, fr Pixel, CAPI
LinkedIn bcookie Insight Tag
Twitter muc_ads Conversion tracking
TikTok ttp Event tracking

GA4 Diagnostics

Check your GA4 data quality:

  1. GA4 Admin → Data Display → Data Quality
  2. Look for "Thresholding applied" warnings
  3. Check Reporting Identity → What data is blended

General Fixes

Fix 1: Implement First-Party Data Strategy

Prioritize first-party data collection:

// Enhanced first-party data collection
const userData = {
  email: getHashedEmail(), // SHA-256 hashed
  phone: getHashedPhone(),
  user_id: getUserId(),
  client_id: getClientId()
};

// Send to GA4
gtag('set', 'user_data', {
  email: userData.email,
  phone_number: userData.phone
});

// Enhanced Conversions
gtag('config', 'AW-XXXXXXX', {
  user_id: userData.user_id
});

Fix 2: Set Up Server-Side Tracking

Server-side tracking uses first-party cookies:

// Server-side GTM configuration
// Your server container at sgtm.yourdomain.com

// Client-side sends to first-party endpoint
gtag('config', 'G-XXXXXXXXXX', {
  transport_url: 'https://sgtm.yourdomain.com',
  first_party_collection: true
});

Benefits:

  • First-party cookies (not affected by browser restrictions)
  • Better data quality
  • Ad blocker resistant
  • Enhanced privacy control

Required for EEA/UK remarketing:

gtag('consent', 'default', {
  'analytics_storage': 'denied',
  'ad_storage': 'denied',
  'ad_user_data': 'denied',
  'ad_personalization': 'denied',
  'wait_for_update': 500
});

// When user consents
gtag('consent', 'update', {
  'analytics_storage': 'granted',
  'ad_storage': 'granted',
  'ad_user_data': 'granted',
  'ad_personalization': 'granted'
});

Fix 4: Implement Enhanced Conversions

Enhanced Conversions use hashed first-party data:

// Enhanced Conversions for Google Ads
gtag('set', 'user_data', {
  email: 'sha256_hashed_email',
  phone_number: 'sha256_hashed_phone',
  address: {
    first_name: 'sha256_hashed_first_name',
    last_name: 'sha256_hashed_last_name',
    street: 'sha256_hashed_street',
    city: 'sha256_hashed_city',
    region: 'sha256_hashed_region',
    postal_code: 'sha256_hashed_postal_code',
    country: 'US'
  }
});

Fix 5: Use Privacy Sandbox APIs

Adopt Chrome's Privacy Sandbox solutions:

Topics API (for interest-based advertising):

// Check for Topics API support
if ('browsingTopics' in document) {
  document.browsingTopics().then(topics => {
    console.log('User topics:', topics);
  });
}

Attribution Reporting API:

<!-- Register conversion source -->
<a href="https://shop.example"
   attributionsrc="https://adtech.example/register-source">
  Buy Now
</a>

Fix 6: Implement Meta Conversions API

Server-side tracking for Meta:

// Server-side Conversions API
const payload = {
  data: [{
    event_name: 'Purchase',
    event_time: Math.floor(Date.now() / 1000),
    action_source: 'website',
    user_data: {
      em: [hashSHA256(email)],
      ph: [hashSHA256(phone)],
      client_ip_address: clientIP,
      client_user_agent: userAgent,
      fbc: fbcCookie,
      fbp: fbpCookie
    },
    custom_data: {
      value: orderValue,
      currency: 'USD'
    }
  }]
};

await fetch(`https://graph.facebook.com/v18.0/${pixelId}/events`, {
  method: 'POST',
  body: JSON.stringify(payload),
  headers: { 'Content-Type': 'application/json' }
});

Chrome DevTools

  1. Open DevTools → Application → Cookies
  2. Filter by third-party
  3. Check which cookies are blocked
// Enable third-party cookie blocking in Chrome:
// chrome://flags/#test-third-party-cookie-phaseout

// Or use command line:
// --test-third-party-cookie-phaseout

GTM Preview Mode

  1. Enable Preview mode
  2. Navigate through your site
  3. Check which tags fire without third-party cookies
  4. Identify tags that fail

Migration Checklist

Short-Term (Now)

  • Audit third-party cookie dependencies
  • Implement first-party data collection
  • Set up Enhanced Conversions (Google Ads)
  • Configure Conversions API (Meta)
  • Enable Consent Mode v2

Medium-Term (3-6 months)

  • Deploy server-side GTM
  • Migrate to first-party cookie-based tracking
  • Test Privacy Sandbox APIs
  • Update attribution models

Long-Term (6-12 months)

  • Full server-side implementation
  • Privacy Sandbox adoption
  • First-party data strategy matured
  • Probabilistic attribution models

Platform-Specific Guides

Platform Guide
Shopify Shopify Cookie Deprecation
WordPress WordPress Privacy Tracking
Commercetools Headless Cookie Strategy

Further Reading

// SYS.FOOTER