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 search listing page

Overview

A search listing page shows multiple products; it can be a category page or a search result page. Implementing the Criteo OneTag on these pages allows us to track a user's interest in a certain kind of product (eg. products of a particular category).

Many users just browse your search listing and category pages and don't click through to the product specific pages, so implementing the Criteo OneTag on these pages is key to tracking these users.

You must implement the Criteo OneTag within the header of every page of your site. The tag loads asynchronously, so it won't interfere with the page loading time or user experience.

When implementing Criteo OneTag on a search result or category listing page, you will have to pass dynamically the product IDs for the top three products displayed on the page, the SiteType and Email parameters.

Criteo OneTag implemented on a search listing 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: "viewList", item: ["FIRST PRODUCT ID", "SECOND PRODUCT ID", "THIRD PRODUCT ID"] }
);
</script>

The viewList event

The viewList event is the Criteo OneTag specific event triggered when the tag is implemented on a search result or category listing page. The IDs of the top three products displayed to the user on the page have to be passed using the item parameter.

 { event: "viewList", item: ["FIRST PRODUCT ID", "SECOND PRODUCT ID", "THIRD PRODUCT ID"] }

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

For example, if the IDs for the top three products displayed on the search result or category listing page are A111, B234 and H556, the viewList event will look like this:

 { event: "viewList", item: ["A111", "B234", "H556"] }

setSiteType parameter

The SiteType parameter is a dynamic parameter that will be present in the Criteo OneTag across all the pages of your site. If your site has different versions, 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 of setEmail parameter with empty value:

 { 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. 

Example of setHashedEmail parameter with hashed email address user@example.com:

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

Please leave it blank if the email address is unavailable:

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