Help menu

Google Tag Manager Implementation

The fastest way to deploy SEM. The GTM template handles script loading, user data hashing, and Consent Mode for you – just configure your tags and connect them to the dataLayer.

This documentation is based on Pavel Šabatka’s GTM template
The template is available in the GTM Community Gallery and on GitHub. Full author documentation: sabatka.net.

Step 1 – Find your SEM ID

The GTM template requires a SEM ID – see Where to find SEM ID?.

Correct procedure:

  1. Go to Sklik → Account settings
  2. Click the copy icon next to the SEM ID for the relevant record
  3. If you have Seznam Shopping store outlets, use the combined SEM ID for the appropriate outlet

Step 2 – Install the template in GTM

1. Open your GTM container

Sign in to Google Tag Manager and open your website container.

2. Add the template from the Gallery

In the left menu click Templates → Template Gallery. Search for “Seznam SEM” or “Sabatka” and add the template to your container, or use the direct link to GTM Gallery.

Step 3 – Create a PageView tag

The PageView tag fires on every page. It is the foundation of the entire implementation – it initialises the SEM script and sends basic visit data.

1. Create a new tag

Tags → New → select tag type Seznam SEM (the template you just added).

2. Fill in the required fields

FieldValue
Seznam IDYour SEM ID copied in Step 1
Event namePageView

3. Set the trigger

Assign the All Pages trigger (or an equivalent trigger for all page views in your SPA).


4. Configure Consent Mode

If your website uses Consent Mode v2, keep the option “I use Consent Mode v2” checked – the template will read consent state automatically.

If you do not use Consent Mode v2, uncheck the option and fill in consent status manually. See the Consent management section for details.

Step 4 – E-commerce tags

For each tracked action (product view, cart, purchase…) create a separate tag. Each tag reads data from the dataLayer – your website must push the relevant data to the dataLayer when these actions occur.

dataLayer format

The template accepts product data in Google Enhanced Ecommerce (GA4) or Shoptet format. If you already have a GA4 ecommerce implementation on your site, you can reuse the dataLayer data without any changes.

ViewContent

Push to dataLayer on the product detail page:

dataLayer.push({
  event: 'seznam_view_content',       // trigger name in GTM
  ecommerce: {
    currency: 'CZK',
    value: 33490,
    items: [{
      item_id: 'ABC12345',
      item_name: 'iPhone 15 Pro Max',
      item_category: 'Elektronika | Mobilní telefony | Apple',
      price: 33490,
      quantity: 1
    }]
  }
});

Tag configuration in GTM:

FieldValue
Event nameViewContent
Content Typeproduct (product detail) or product_group (category)
ProductsGTM variable: {{ecommerce.items}}
CurrencyGTM variable: {{ecommerce.currency}}
ValueGTM variable: {{ecommerce.value}}

AddToCart

Push to dataLayer when a product is added to cart:

dataLayer.push({
  event: 'seznam_add_to_cart',
  ecommerce: {
    currency: 'CZK',
    value: 33490,
    items: [{
      item_id: 'ABC12345',
      item_name: 'iPhone 15 Pro Max',
      item_category: 'Elektronika | Mobilní telefony | Apple',
      price: 33490,
      quantity: 1
    }]
  }
});

Tag configuration: Event name = AddToCart, Products = {{ecommerce.items}}.

Purchase

Push to dataLayer on the order confirmation page:

dataLayer.push({
  event: 'seznam_purchase',
  ecommerce: {
    transaction_id: 'OBJ-987654',
    currency: 'CZK',
    value: 33990,          // product price excluding VAT
    tax: 7138,
    shipping: 120,
    items: [
      {
        item_id: 'ABC12345',
        item_name: 'iPhone 15 Pro Max',
        item_category: 'Elektronika | Mobilní telefony | Apple',
        price: 33490,
        quantity: 1
      },
      {
        item_id: 'KRYT999',
        item_name: 'Ochranný kryt',
        item_category: 'Elektronika | Příslušenství | Kryty na telefon',
        price: 500,
        quantity: 1
      }
    ]
  },
  // pass review_email outside the ecommerce object – it will not be hashed
  review_email: 'zakaznik@email.cz'
});

Tag configuration in GTM:

FieldValue
Event namePurchase
OrderGTM variable mapping the ecommerce object
ProductsGTM variable{{ecommerce.items}}
Content Typeproduct

review_email must not be hashed
The template automatically hashes user data with SHA-256. Pass the review_email parameter for the Seznam Shopping customer satisfaction survey outside the user object – otherwise it will be hashed and the survey will not work.

Implementation without template (Custom HTML)

SEM can be deployed in GTM in two ways – via the GTM template (described above) or manually using Custom HTML tags. Both approaches are fully featured; the choice depends on your preferences and the existing structure of your GTM container. Custom HTML tags give you greater control over firing order and do not require installing a template..

Recommended tag structure

Create three types of tags:

TagContentTrigger
Seznam SEM – baseLoad sul.jsAll Pages
Seznam SEM – pageview eventSend PageView eventAll Pages
Seznam SEM – [name] eventSend a specific eventRelevant trigger

Tag code

base – loads the script, sends no event:

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

pageview event – sends PageView (fire on All Pages):

<script>
if (typeof window.SEM === "function") {
    SEM('track', 'PageView');
}
</script>

Other events (Contact, Lead, etc.) – same pattern:

<script>
if (typeof window.SEM === "function") {
    SEM('track', 'Contact');
}
</script>

Tag firing sequence
Because sul.js loads asynchronously, all other event tags must have a configured tag sequencing – in the tag settings check “Fire a tag before [this tag] fires” and select the base tag. Without this setting, window.SEM may not yet be available when the event tag fires and the event will not be sent. GTM tag firing priority alone is not sufficient for asynchronous scripts.

Recommended tag set

Create one tag for each page type / action:

Page / actionTag (event)Trigger
All pagesPageViewAll Pages
Product detail pageViewContent (content_type: product)Custom event: seznam_view_content
Category pageViewContent (content_type: product_group)Custom event: seznam_view_category
Add to cartAddToCartCustom event: seznam_add_to_cart
Checkout initiatedInitiateCheckoutCustom event: seznam_initiate_checkout
Order confirmationPurchaseCustom event: seznam_purchase
SearchSearchCustom event: seznam_search
Form submissionLeadCustom event or Form Submit trigger

Custom event names are flexible
Events such as seznam_purchase are recommended conventions only. If you already have different names in the dataLayer (e.g. from a GA4 implementation), use those – just configure the corresponding trigger in GTM.

User data in GTM

To pass an email address or other user data, use the User Object section in the tag configuration. The template automatically hashes the data with SHA-256 before sending – pass it in plain text.

Typically it is sufficient to add the User Object to the PageView tag (or to a dedicated UserDataUpdate tag) and configure the variable from a dataLayer, cookie, or JS variable where the user’s email is available.

dataLayer.push({
  event: 'seznam_user_data',
  user: {
    email: 'jan.novak@email.cz',   // hashed automatically by the template
    phone: '+420606666666',
    first_name: 'Jan',
    last_name: 'Novák'
  }
});

Content Security Policy

If your website uses CSP headers, add these permissions:

Content-Security-Policy:
  script-src l.seznam.cz;       /* can be omitted if GTM uses nonce */
  connect-src https://*.seznam.cz;  /* l.seznam.cz + sem.seznam.cz */

If measurement is not working, check the browser console for a “Refused because of Content Security Policy” error.


📋
Event reference
Complete parameters for each event.
🧪
Testing
Verify your implementation in the Sandbox before going live.
🔐
Consent Mode
Configure consent without Consent Mode v2.

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.