Help menu

Basic script

The most universal deployment method – paste the code directly into your website’s HTML template. Suitable for developers with direct access to the source code.

Before you start:

You will need:

Which websites is the direct script suitable for?
Direct implementation is best for simple websites – landing pages, single-page sites, service websites without e-commerce. For e-shops using GTM we recommend the GTM template, which covers e-commerce events more comprehensively.

Step 1 – Copy the script from Account Settings

In Sklik → Account Settings, click Show SEM code next to the relevant SEM ID. A dialog with the complete script will open – copy it and paste it into the <head> section of every page on your website.

The script looks like this:

<!-- Insert into <head> on every page of your website -->
<script src="https://l.seznam.cz/sul.js?id=VASE_SEM_ID"></script>
<script>
if (typeof window.SEM === "function") {
  SEM('track', 'PageView');
}
</script>

The script provides:

  • Automatic PageView event sent on every page load
  • Writing of sid and udid cookies for user identification
  • Automatic consent loading from the IAB TCF API (if your website uses TCF)

If your website uses the standardisedIAB Transparency and Consent Framework (TCF), consent is passed automatically – skip this step.

If you don’t use TCF, pass consent information manually using the updateConsent – method – always before calling PageView:

const consentData = {
  consent_mode: {
    ad_storage: 'granted',          // cookie storage
    ad_user_data: 'granted',        // identifier processing
    ad_personalization: 'granted',  // ad personalisation
    functionality_storage: 'denied',
    analytics_storage: 'denied'
  }
};

SEM('updateConsent', consentData);

Consent must come before PageView
The sid cookie is only generated after consent with ad_storage: 'granted' is received. If you pass consent after PageView, sid may not be available – this is especially important for S2S measurement, where you need to read the cookie explicitly.

Step 3 – Send user data (optional, recommended)

After a user signs in or completes an order, we recommend sending the user data – customer’s e-mail address – ideally before calling PageView. The script automatically hashes it (SHA-256) and uses it for accurate conversion matching even without cookies.

const userData = {
  em: "jan.novak@email.cz",   // key identifier – hashed automatically
  ph: "+420606666666",
  fn: "Jan",
  ln: "Novák"
};

SEM('updateUserData', userData);

Hashing happens automatically
You can pass values in plain text. The SEM script normalises and hashes them using the SHA-256 algorithm directly in the browser before sending. Exception: the review_email parameter in the Purchase event – this must not be hashed, as it is needed to send the customer satisfaction survey for the completed purchase.

Step 4 – Add events to the relevant pages

Add the appropriate events to your product pages, cart, checkout and order confirmation page. See the Event reference for a complete list.

Example of a complete code snippet for a product page:

<!-- In <head> -->
<script src="https://l.seznam.cz/sul.js?id=VASE_SEM_ID"></script>

<!-- After the page body, once product data is available -->
<script>
if (typeof window.SEM === "function") {

  // 1. Consent – if you don't use IAB TCF, pass consent manually
  SEM('updateConsent', {
    consent_mode: {
      ad_storage: 'granted',
      ad_user_data: 'granted',
      ad_personalization: 'granted',
      analytics_storage: 'granted',
      functionality_storage: 'granted'
    }
  });

  // 2. User data – optional, recommended for signed-in users
  SEM('updateUserData', {
    em: 'jan.novak@email.cz'  // hashed automatically
  });

  // 3. PageView
  SEM('track', 'PageView');

  // 4. ViewContent – product detail (for DRTG and retargeting)
  SEM('track', 'ViewContent', {
    content_type: 'product',
    currency: 'CZK',  // only CZK supported
    value: 27677,          // excl. VAT
    contents: [{
      id: 'ABC12345',
      content_name: 'iPhone 15 Pro Max',
      content_category: 'Elektronika | Mobilní telefony | Apple',
      unit_price: 33490      // incl. VAT
    }]
  });
}
</script>

Content Security Policy (CSP)

If your website uses CSP headers, add these allowed sources:

Content-Security-Policy:
  script-src l.seznam.cz;
  connect-src https://*.seznam.cz;

SPA aplikace (React, Vue, Next.js…)

In single-page applications the page does not reload on navigation. Call PageView manually on every route change:

import { useEffect } from 'react';
import { useLocation } from 'react-router-dom';

function PageViewTracker() {
  const location = useLocation();
  useEffect(() => {
    if (typeof window.SEM === 'function') {
      SEM('track', 'PageView');
    }
  }, [location.pathname]);
  return null;
}
📋
Event reference
Complete list of events and parameters for every page type.
🔐
Consent management
Details on passing consent via TCF and Google Consent Mode.
🧪
Testing
How to verify your implementation in the sandbox environment.

Multiple SEM IDs on one page

If you operate a website where you need to track for multiple Sklik accounts simultaneously (e.g. a marketplace with multiple sellers, or a site combining your own tracking with a client’s), set sem_id directly in each track call. A SEM ID specified in a track call takes precedence over the globally configured ID.

// Tracking for the first account
SEM('track', 'PageView', {
  sem_id: 'VASE_SEM_ID_1'
});

// Tracking for the second account (same event, different SEM ID)
SEM('track', 'PageView', {
  sem_id: 'VASE_SEM_ID_2'
});

sem_id in track vs. in config
The global sem_id set via SEM('config', ...) is used for all calls where sem_idis not explicitly specified. Once you provide sem_id directly in a track call, it overrides the global value for that single call only.

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.