Help menu

Consent management

SEM respects the user’s consent for tracking. How consent is passed depends on which consent management solution your website uses.

How SEM handles consent

SEM supports two standardised methods of passing consent. The system always prioritises IAB TCF if available – Google Consent Mode serves as an alternative.

MethodWhen usedWhat you need to do
IAB TCF (automatic)Website uses a CMP compatible with IAB TCF v2Nothing – SEM reads the TCF consent string automatically from the API
Google Consent Mode (manual)Website does not use TCF but has its own cookie bannerCall updateConsent when consent changes

Using IAB TCF?
If your Consent Management Platform (CMP) implements IAB Transparency and Consent Framework v2, consent is passed to Sklik automatically. The updateConsent method described below does not need to be implemented.

Manual passing – Google Consent Mode

If your website does not support TCF, inform SEM about the consent status using SEM('updateConsent', consentData). Call it:

  • on page initialisation – with the default consent state (usually denied)
  • after the user interacts with the cookie banner – with the updated state
const consentData = {
  consent_mode: {
    ad_storage: 'granted',          // storing advertising cookies
    ad_user_data: 'granted',        // processing user identifiers
    ad_personalization: 'granted',  // ad personalisation
    functionality_storage: 'denied',
    analytics_storage: 'denied'
  }
};

SEM('updateConsent', consentData);

consent_mode parameters

SEM works with five keys according to the Google Consent Mode v2 specification. Allowed values are 'granted' and 'denied'.

KeyWhat it affectsImpact on SEM
ad_storageStoring and reading advertising cookiesRequired for sid and udid cookies to work
ad_user_dataSending user data to advertising systemsRequired for processing hashed user identifiers
ad_personalizationPersonalisation of advertising contentRequired for retargeting and personalised campaigns
functionality_storageStoring functional cookiesOptional for SEM
analytics_storageAnalytics cookiesOptional for SEM

Typical implementation patterns

Default denied

Set the default state before the cookie banner loads (state before user interaction):

// Default state – user has not yet consented
SEM('updateConsent', {
  consent_mode: {
    ad_storage: 'denied',
    ad_user_data: 'denied',
    ad_personalization: 'denied',
    functionality_storage: 'denied',
    analytics_storage: 'denied'
  }
});

Update after consent

After the user confirms consent (callback from your cookie banner):

// Call after clicking "Accept all" in the cookie banner
function onConsentGranted() {
  SEM('updateConsent', {
    consent_mode: {
      ad_storage: 'granted',
      ad_user_data: 'granted',
      ad_personalization: 'granted',
      functionality_storage: 'granted',
      analytics_storage: 'granted'
    }
  });
}

Full initialisation

Full page initialisation – consent, user data and PageView in the correct order:

<script src="https://l.seznam.cz/sul.js?id=VASE_SEM_ID"></script>
<script>
if (typeof window.SEM === "function") {

  // 1. Pass consent (if you are not using IAB TCF)
  SEM('updateConsent', {
    consent_mode: {
      ad_storage: userConsentStatus,        // 'granted' or 'denied'
      ad_user_data: userConsentStatus,
      ad_personalization: userConsentStatus,
      functionality_storage: 'denied',
      analytics_storage: 'denied'
    }
  });

  // 2. Pass user data (if available)
  if (currentUserEmail) {
    SEM('updateUserData', { em: currentUserEmail });
  }

  // 3. Send PageView
  SEM('track', 'PageView');
}
</script>

S2S measurement – passing consent in the payload

With Server-to-Server measurement you pass consent directly in the JSON payload. If a TCF consent string is available, use the consent_string key and it will take priority. Use consent_mode as an alternative.

{
  // Option A: IAB TCF consent string (preferred)
  "consent_string": "CPCXzW8CPCXzW8AAAENAPCAAQAAAAAAAAA...",

  // Option B: Google Consent Mode (alternative)
  "consent_mode": {
    "ad_storage": "granted",
    "ad_user_data": "granted",
    "ad_personalization": "granted",
    "functionality_storage": "denied",
    "analytics_storage": "denied"
  }
}

Potřebujete další pomoc?

Pokud si stále nevíte rady, obraťte se na naše specialisty. 95 % vašich dotazů umíme vyřešit do 2 hodin.