Sign in

Welcome to our Support Center

Get help with integration and live campaigns

Welcome to our Support Center. Get help with integration and live campaigns

The structure of the Criteo OneTag

The Criteo OneTag must be implemented within the header code of your site.
The tag loads asynchronously so it won't interfere with the page loading time or user experience.

Here's an example of how the Criteo OneTag is implemented on a homepage:

<script type="text/javascript" src="//static.criteo.net/js/ld/ld.js" async="true">
</script> <script type="text/javascript">
window.criteo_q = window.criteo_q || [];
window.criteo_q.push(
        { event: "setAccount", account: YOUR UNIQUE ACCOUNT ID },
        { event: "setSiteType", type: "m FOR MOBILE OR t FOR TABLET OR d FOR DESKTOP" },
      { event: "setEmail", email: "TRIMMED AND LOWERCASE USER EMAIL ADDRESS" },
        { event: "viewHome"} ); </script>

 

  Loader

The loader will recognize and adapt automatically to the protocol of your site: http or https, please do not modify the loader.

Criteo loader:

 <script type="text/javascript" src="//static.criteo.net/js/ld/ld.js" async="true"></script>

  Account ID parameter

The Criteo Account ID parameter is unique to your Criteo account. Please do not modify this value.

Account ID parameter:

 { event: "setAccount", account: YOUR UNIQUE ACCOUNT ID },

  setSiteType parameter

The setSiteType parameter is present in Criteo OneTag across all the pages of your site. If your site has different versions to accommodate mobile devices, indicate which version of your site is displayed to the user via setSiteType parameter:

  • d for desktop
  • m for mobile
  • t for tablet

If you do not have a mobile or tablet-specific site, set the value to d

setSiteType parameter on the desktop version of a site:

 { event: "setSiteType", type: "d" },

setSiteType parameter on the mobile version of a site:

 { event: "setSiteType", type: "m" },

setSiteType parameter on the tablet version of a site:

 { event: "setSiteType", type: "t" },

  Email parameter

The email parameter is present in every Criteo OneTag implemented across all the pages of your site. This parameter is used by Criteo Cross Device to accurately match users across multiple devices. In the email parameter field, pass the customer email address (trimmed and converted to lowercase) and we will hash it automatically using an MD5 algorithm before storing it on our servers. Hashed emails are irreversibly encrypted and anonymous, so Criteo has no access to your users’ email addresses.

setEmail parameter:

 { event: "setEmail", email: "user@example.com" },

Please leave this parameter blank if an email address is unavailable.

setEmail parameter with empty value:

 { event: "setEmail", email: "" },

Alternatively, you can pass the encrypted email address using an MD5 hash function (this page gives some examples of calling MD5 hash functions in different programming languages). In this case, you should replace the default "setEmail" with “setHashedEmail” as shown below.

The email address will need to be trimmed and converted to lowercase before being encrypted using a MD5 hash function. You can then pass the encrypted string into the setHashedEmail parameter. 

Example of hashed email address user@example.com

setHashedEmail parameter:

 { event: "setHashedEmail", email: "b58996c504c5638798eb6b511e6f49af" },

 Please leave this parameter blank if an email address is unavailable.

 { event: "setHashedEmail", email: "" },

  Page specific event parameter

The last event parameter varies depending on the page where the Criteo OneTag is implemented;
Was this article helpful?
0 out of 0 found this helpful
Powered by Zendesk