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

Criteo OneTag on your Product page

Overview

In terms of the Criteo OneTag, a Product page contains details of a specific product. Installing the Criteo OneTag on product pages is key to the tracking process because this is where user intent is expressed most strongly. There are many users who land directly on product pages without going through your search listing pages.

The Criteo OneTag should be implemented within the header code of every page of your site. The tag loads asynchronously, so it will not interfere with the page loading time or user experience.

When implementing the Criteo OneTag on a Product page you will have to dynamically pass the ID of the product displayed on the page, the siteType and email parameters.

This is how the Criteo OneTag is implemented on a Product page:

<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: "viewItem", item: "YOUR PRODUCT ID" }
);
</script>

The viewItem event

The viewItem event is the Criteo OneTag specific event used when the tag is implemented on a Product page. The ID of the product displayed to the user on the page must be passed on the item parameter.

 { event: "viewItem", item: "YOUR PRODUCT ID" }

The product ID passed on the Criteo OneTag tag must be exactly the same ID as that in your product data feed.

If the ID for the product displayed on the page is B234, the vewItem event will look like:

 { event: "viewItem", item: "B234" }

setSiteType parameter

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

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

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 vesion of a site:

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

More information on the site type here

setEmail parameter

The email parameter is a dynamic parameter that will be present in the Criteo OneTag 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 Criteo will hash it using the MD5 algorithm before it is stored on our servers. Hashed emails are irreversible and anonymous, so Criteo will have no access to your users' email addresses.

setEmail parameter example:

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

Please leave it blank if an email address is unavailable. Example:

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

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

Finally, pass the dynamically encrypted email address (trimmed and converted to lowercase).

Example of hashed email address user@example.com:

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

Please leave it blank if the email address is unavailable. Example:

 { event: "setHashedEmail", email: "" },
Was this article helpful?
0 out of 0 found this helpful
Powered by Zendesk