Help menu

Retargeting code

To start using both Retargeting and Dynamic Retargeting, you need to place a retargeting code on your website. This is a short html code that must be placed on every page of your website where you want to record visitors for ad targeting. If you want to cover the whole site, place the code in a section that is common to the whole site such as the footer of the page, or use Google Tag Manager.

Example of the RTG code

<script src="https://c.seznam.cz/js/rc.js"></script>
<script>

    /* setting of the identity object */
    window.sznIVA.IS.updateIdentities({  
        eid: "email.zakaznika@email.cz", // email or hashed email
        aid: {
            "a1":"Česká republika", // fill in the country
            "a2":"Praha", // fill in the city
            "a3":"Radlická", // fill in the street
            "a4":"3294/10, // fill in house number
            "a5":"150 00", // fill in the postcode
        },
        tid: "+420 234 694 111" // fill in the phone number
    });

    /* setting of a retargetting hit */
    var retargetingConf = {
        rtgId: 123456, /* retargeting identifier */
        itemId: "67890", /* offer identifier */
        category: "Zahrada | Stínící technika | Zahradní slunečníky", /* e-shop category */
        pageType: "offerdetail", /* page type - offerdetail,  category */
        rtgUrl: "https://example.com?hello=world", /* URL including optional parameters */
        consent: 1, /* consent from the visitor to send a retargeting hit, allowed values: 0 (no consent) or 1 (consent) */
    };

   window.rc.retargetingHit(retargetingConf);

</script>

If you are an e-shop and want to get all the benefits of Dynamic retargeting, use the advanced retargeting code to offer specific products or categories of your e-shop.

Retargeting identifier – rtgId (required)

Unique identifier. Use the value according to the value from the Sklik interface.

The conversion and retargeting codes need information from the advertiser if they have consent from the visitor to their website to retarget them via cookies in the advertising network and to track them for conversion measurement (Act No. 127/2005 Coll., on electronic communications).

The retargeting code supports the consent parameter, which is used by the advertiser to tell Seznam whether the user has consented to targeted advertising or conversion measurement. If consent exists (value 1), Seznam.cz processes the data in the usual way, including recording and reading cookies. If consent is not given (value 0), the system processes the data anonymously in accordance with the law (it does not store or read information from the user’s device).

The implementation may vary according to the selected cookie bar in which the user sets the consent mode. The implementation must be guided by the technical possibilities of the selected cookie bar.

When using the consent parameter, it is recommended to run the retargeting code immediately after the page is loaded with the value 0 in the consent parameter (consent: 0), meaning that consent has not yet been granted and the data will be processed anonymously. If the user then confirms consent in the cookie bar, run the retargeting code again on the same page with a value of 1 (consent: 1). This will ensure that once consent has been granted, full processing of data from the landing page (the first page visited) is possible, which may be key to your retargeting.

In cases where you cannot use the consent parameter in your implementation, run the retargeting code only after consent has been granted. In this case, data will only be processed for users who have provided verifiable consent. This method does not allow for later advanced methods to model missing data.

If the user withdraws consent, the conversion and retargeting code must be run with a value of 0. Seznam.cz will then process any identifiers sent anonymously in accordance with the law.

Identifier of the e-shop offer – itemId (optional)

Use in case of specific URLs, different variantions of one offer or when the offer URLs do not match the URLs in the feed. Find more information.

Identifier of e-shop category – category (optional)

Use if you want to extend the reach of dynamic retargeting to users who have visited your e-shop categories. Find more information.

Identifier of the page type – pageType (optional)

It is mandatory if you use the e-shop category identifier, or the e-shop offer identifier. It can have values offerdetail or category.

Optional query string – rtgUrl (optional)

Use if you want to specify which data from the URL should be sent. Find more information.

User’s hashed email address – eid (preferred)

Provides identification of visitors of your website by email address for the purposes of populating retargeting audiences and measuring conversions if the browser blocks 3rd party cookies. We expect this to be the majority of internet traffic during 2024.

It is possible to forward a hashed email address using SHA-256 version 2. The email address can be obtained by your own logging system, or logging in via Seznam, Google, Facebook, MojeID, etc. You must have the user’s consent to do this in accordance with current legislation.

How to process a user’s email?

  1. Remove the whitespace from the user’s email (before and after)
  2. Convert it to lower case
  3. Convert it to a UTF-8 encoded string
  4. Encrypt it with the SHA-256 algorithm
  5. Convert it to a hexadecimal string

How to forward a user’s email?

Once the user is successfully authenticated and logged in to your site, obtain the email address and process it as described above.

A detailed overview of the implementation, including code samples in different languages, can be found on this page.

If the services you use don’t allow you to use hashing, or you don’t want to use it for any other reason, you can leave it to Seznam. Send an email in the given parameter and the retargeting or conversion code (or their script) will hash the email for you according to the mentioned procedure.

If you are submitting e-mail address (EID) to Seznam as an identifier for ad targeting, it is necessary that the process complies with the law. We recommend that you do the following on your website:

  1. Inform your website visitors about this change directly (e.g. in the cookie bar)
  2. Extend your e-shop’s privacy policy to:
  • Identification of Seznam.cz, a.s., as a processor of personal data for the purpose of targeted advertising
  • Information that, in addition to cookies, the consent granted also covers the e-mail address (EID) and other possible identifiers (AID, TID) and their sharing with Seznam.cz, a.s.

User’s address – aid (optional)

Detailed information on the parameter including the required format can be found on this link.

This parameter is not currently used but can be sent. We expect to start using it during Q2 2024. Earlier implementation can give you a head start on your competitors.

User’s telephone number – tid (optional)

Detailed information on the parameter including the required format can be found on this link.

Where do I get the retargeting code in the Sklik interface?

If you want to add information about the user’s consent to targeted advertising, use advanced dynamic retargeting options or if you are an e-shop and you use Zboží.cz, we recommend using the advanced retargeting code, where you insert the necessary parameters and their corresponding values (or let them be dynamically inserted).

1. Click on Tools in the menu

2. Select Retargeting (see the image below)

3. Click on View retargeting code

4. Copy the entire retargeting code and place it on all the pages of the website from which you want to “collect” users. Or you can send the retargeting code to your webmaster who will take care of the implementation.