블로그로 돌아가기
Technical

Snapchat Pixel GDPR Consent: Complete Guide

GetCookies 팀December 26, 20247분 소요
SnapchatAdvertisingGDPRConsent

TLDR: Snapchat Pixel requires consent for EU users. GetCookies blocks it until marketing consent using a simple data attribute. Essential for Gen Z advertising.

Read full summary

Snapchat advertising reaches younger demographics that other platforms miss. The Snap Pixel requires proper consent handling in the EU. This guide shows how to implement it correctly.

Summary by Claude AI

Reaching Gen Z? You Need Compliant Tracking

Snapchat is where Gen Z lives. If your audience skews young, Snapchat ads are essential.

But like every other platform, Snap Pixel requires consent in the EU. Fire it without permission, and you're breaking the law.

The GetCookies Implementation

<head>
  <!-- GetCookies -->
  <script src="https://getcookies.co/api/v1/widget/loader.js"
          data-domain-id="YOUR_DOMAIN_ID"
          async></script>

  <!-- Snapchat Pixel - only after marketing consent -->
  <script type="text/plain" data-cookieconsent="marketing">
    (function(e,t,n){
      if(e.snaptr)return;
      var a=e.snaptr=function(){
        a.handleRequest?a.handleRequest.apply(a,arguments):a.queue.push(arguments)
      };
      a.queue=[];
      var s='script';
      var r=t.createElement(s);r.async=!0;
      r.src=n;
      var u=t.getElementsByTagName(s)[0];
      u.parentNode.insertBefore(r,u);
    })(window,document,'https://sc-static.net/scevent.min.js');

    snaptr('init', 'YOUR_PIXEL_ID', {
      'user_email': '__INSERT_USER_EMAIL__'
    });
    snaptr('track', 'PAGE_VIEW');
  </script>
</head>

The type="text/plain" blocks execution. GetCookies activates it after marketing consent.

Event Tracking

After consent:

// Page view
snaptr('track', 'PAGE_VIEW');

// Purchase
snaptr('track', 'PURCHASE', {
  'currency': 'USD',
  'price': 99.99,
  'transaction_id': 'order_123'
});

// Add to cart
snaptr('track', 'ADD_CART', {
  'currency': 'USD',
  'price': 29.99,
  'item_ids': ['SKU123']
});

// Sign up
snaptr('track', 'SIGN_UP');

// Custom event
snaptr('track', 'CUSTOM_EVENT_1');

Dynamic Loading Pattern

window.addEventListener('getcookies:consent', (e) => {
  if (e.detail.marketing && !window.snapLoaded) {
    loadSnapPixel();
    window.snapLoaded = true;
  }
});

function loadSnapPixel() {
  (function(e,t,n){
    if(e.snaptr)return;
    var a=e.snaptr=function(){
      a.handleRequest?a.handleRequest.apply(a,arguments):a.queue.push(arguments)
    };
    a.queue=[];
    var s='script';var r=t.createElement(s);r.async=!0;
    r.src=n;var u=t.getElementsByTagName(s)[0];
    u.parentNode.insertBefore(r,u);
  })(window,document,'https://sc-static.net/scevent.min.js');

  snaptr('init', 'YOUR_PIXEL_ID');
  snaptr('track', 'PAGE_VIEW');
}

Snapchat Conversions API (Server-Side)

For better attribution:

import requests
import hashlib

url = "https://tr.snapchat.com/v2/conversion"

headers = {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Content-Type": "application/json"
}

payload = {
    "pixel_id": "YOUR_PIXEL_ID",
    "timestamp": "1640000000000",
    "event_type": "PURCHASE",
    "event_conversion_type": "WEB",
    "hashed_email": hashlib.sha256("[email protected]".encode()).hexdigest(),
    "price": 99.99,
    "currency": "USD"
}

response = requests.post(url, headers=headers, json=payload)

Testing

  1. Use Snap Pixel Helper extension
  2. Load site in incognito
  3. Verify pixel doesn't fire before consent
  4. Accept marketing cookies, verify events fire

The Bottom Line

Snapchat Pixel needs consent. GetCookies makes it trivial:

  1. Add data-cookieconsent="marketing"
  2. Set type="text/plain"
  3. Pixel only loads after consent

Reach Gen Z. Stay compliant.


Ready to make your Snapchat Pixel compliant?

Set up GetCookies in 5 minutes

G

GetCookies 팀

노르웨이 오슬로 Getia AS의 GetCookies 팀이 작성하고 관리합니다. 이 글은 쿠키 동의에 관한 일반 정보이며 법률 자문이 아닙니다.

내 사이트를 무료로 스캔하세요

무료 플랜은 사이트 1개에 배너를 표시하고 매월 쿠키 스캔 3회를 제공합니다. 카드 등록도, 영업 전화도 없습니다.