Criteo OneTag Standard (Retail)

This guide contains the OneTag events you should set up on your retail website. If there are any concerns or questions, please reference our support center or contact your Criteo representative!

[[disclaimer-developer]]

Feed

Please provide your Criteo representative with a Google Shopping Feed if you already have one. If you do not have one already, please build a product feed matching the Criteo Feed Specification.

Email Hashing

[[email_hashing]]

Tags

Below are all the available tags:

  1. Loader Script

  2. Visit Tag

  3. Homepage Tag

  4. Category / Keyword Search / Listing Tag

  5. Product Tag

  6. Add To Cart Tag

  7. Basket / Cart Tag

  8. Sales Tag

Loader Script

The loader script tag is required to enable the rest of the Criteo OneTag events.

Please place the script below in the "head" of your site so it's included on all pages. It only needs to be triggered once per page but calling the script multiple times on a single page will not break anything.

<!-- Criteo Loader File -->
<script
  type="text/javascript"
  src="//dynamic.criteo.com/js/ld/ld.js?a={{accountid}}"
  async="true"
></script>
<!-- END Criteo Loader File -->

Visit Tag

Please fire this event on all pages where no other event is being triggered.

Field Overview Example Syntax Required
Email Address Email address in plain text (if allowed by the law in your country), sha256 hashed email address or MD5 hashed email address. 79054025255fb1a26e4bc422aef54eb4... - Plain text emails
- Sha256 and md5 hashed emails
Required
Hash Method The hashing method used for the email.
- Doesn't need to be included for plain text emails
- For sha265 hashed emails: "sha256"
- For md5 hashed emails: "md5"
sha256 String Required
Zip Code User's shipping address zip code. 12345 String Recommended

Structure

Dynamically replace fields surrounded by ##. See table above for more info on the fields.
You need to send at least one of the setEmail events.

<!-- Criteo Visit Tag -->
<script type="text/javascript">
  window.criteo_q = window.criteo_q || [];
  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
  window.criteo_q.push(
    { event: "setAccount", account: {{accountid}}},
    { event: "setEmail", email: "##Email Address of User##" },
    { event: "setEmail", email: "##SHA256-hashed Email Address of User##", hash_method: "sha256" },
    { event: "setEmail", email: "##MD5-hashed Email Address of User##", hash_method: "md5" },
    { event: "setSiteType", type: deviceType},
    { event: "setZipcode", zipcode: "##Zip Code##" },
    { event: "viewPage" }
  );
</script>
<!-- END Criteo Visit Tag -->

Example

<!-- Criteo Visit Tag -->
<script type="text/javascript">
  window.criteo_q = window.criteo_q || [];
  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
  window.criteo_q.push(
    { event: "setAccount", account: {{accountid}}},
    { event: "setEmail", email: "79054025255fb1a26e4bc422aef54eb4", hash_method: "sha256" },
    { event: "setSiteType", type: deviceType},
    { event: "setZipcode", zipcode: "12345" },
    { event: "viewPage" }
  );
</script>
<!-- END Criteo Visit Tag -->

Homepage Tag

This tag should fire on the homepage or main landing page of your site to tag users and add them to the target audience.

Please fire this event on the homepage or main landing page of your site.

Field Overview Example Syntax Required
Email Address Email address in plain text (if allowed by the law in your country), sha256 hashed email address or MD5 hashed email address. 79054025255fb1a26e4bc422aef54eb4... - Plain text emails
- Sha256 and md5 hashed emails
Required
Hash Method The hashing method used for the email.
- Doesn't need to be included for plain text emails
- For sha265 hashed emails: "sha256"
- For md5 hashed emails: "md5"
sha256 String Required
Zip Code User's shipping address zip code. 12345 String Recommended

Structure

Dynamically replace fields surrounded by ##. See table above for more info on the fields.
You need to send at least one of the setEmail events.

<!-- Criteo Homepage Tag -->
<script type="text/javascript">
  window.criteo_q = window.criteo_q || [];
  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
  window.criteo_q.push(
    { event: "setAccount", account: {{accountid}}},
    { event: "setEmail", email: "##Email Address of User##" },
    { event: "setEmail", email: "##SHA256-hashed Email Address of User##", hash_method: "sha256" },
    { event: "setEmail", email: "##MD5-hashed Email Address of User##", hash_method: "md5" },
    { event: "setSiteType", type: deviceType},
    { event: "setZipcode", zipcode: "##Zip Code##" },
    { event: "viewHome" }
  );
</script>
<!-- END Criteo Homepage Tag -->

Example

<!-- Criteo Homepage Tag -->
<script type="text/javascript">
  window.criteo_q = window.criteo_q || [];
  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
  window.criteo_q.push(
    { event: "setAccount", account: {{accountid}}},
    { event: "setEmail", email: "79054025255fb1a26e4bc422aef54eb4...", hash_method: "sha256" },
    { event: "setSiteType", type: deviceType},
    { event: "setZipcode", zipcode: "12345" },
    { event: "viewHome" }
  );
</script>
<!-- END Criteo Homepage Tag -->

Category / Keyword Search / Listing Tag

This tag should fire on pages with more than one product being recommended. This page can be a search results page, a category listing, or a simple page recommending more than one product. Please note, this does NOT mean you should fire this tag on a product page with a "recommended products" section.

Please fire this event on any page that is recommending more than one product.

Field Overview Example Syntax Required
Email Address Email address in plain text (if allowed by the law in your country), sha256 hashed email address or MD5 hashed email address. 79054025255fb1a26e4bc422aef54eb4... - Plain text emails
- Sha256 and md5 hashed emails
Required
Hash Method The hashing method used for the email.
- Doesn't need to be included for plain text emails
- For sha265 hashed emails: "sha256"
- For md5 hashed emails: "md5"
sha256 String Required
Zip Code User's shipping address zip code. 12345 String Recommended
Product Id Unique id of the product a123 String Required
Category Id The category of the page that the user is browsing. This value should match the category values that are sent in your product catalog Electronics>Audio>Headphones String with the same format as your product catalog No
Search Keyword The keyword entered by the user headphones String No

Structure

Dynamically replace fields surrounded by ##. See table above for more info on the fields.
You need to send at least one of the setEmail events.

<!-- Criteo Listing Tag -->
<script type="text/javascript">
  window.criteo_q = window.criteo_q || [];
  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
  window.criteo_q.push(
    { event: "setAccount", account: {{accountid}}},
    { event: "setEmail", email: "##Email Address of User##" },
    { event: "setEmail", email: "##SHA256-hashed Email Address of User##", hash_method: "sha256" },
    { event: "setEmail", email: "##MD5-hashed Email Address of User##", hash_method: "md5" },
    { event: "setSiteType", type: deviceType},
    { event: "setZipcode", zipcode: "##Zip Code##" },
    { event: "viewList",
      item: [ "##Product Id 1##", "##Product Id 2##", "##Product Id 3##" ],
      category: "##Category Id##",
      keywords: "##Search Keyword##"
    }
  );
</script>
<!-- END Criteo Listing Tag -->

Example

<!-- Criteo Listing Tag -->
<script type="text/javascript">
  window.criteo_q = window.criteo_q || [];
  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
  window.criteo_q.push(
    { event: "setAccount", account: {{accountid}}},
    { event: "setEmail", email: "79054025255fb1a26e4bc422aef54eb4...", hash_method: "sha256" },
    { event: "setSiteType", type: deviceType},
    { event: "setZipcode", zipcode: "12345" },
    { event: "viewList",
      item: [ "a123", "b123", "c123" ],
      category: "Electronics>Audio>Headphones",
      keywords: "headphones"
    }
  );
</script>
<!-- END Criteo Listing Tag -->

Product Tag

This tag gives our engine a clear flag for the product a user is looking at.

Please fire this event on any product details page.

Field Overview Example Syntax Required
Email Address Email address in plain text (if allowed by the law in your country), sha256 hashed email address or MD5 hashed email address. 79054025255fb1a26e4bc422aef54eb4... - Plain text emails
- Sha256 and md5 hashed emails
Required
Hash Method The hashing method used for the email.
- Doesn't need to be included for plain text emails
- For sha265 hashed emails: "sha256"
- For md5 hashed emails: "md5"
sha256 String Required
Zip Code User's shipping address zip code. 12345 String Recommended
Product Id Unique id of the product a123 String Required

Structure

Dynamically replace fields surrounded by ##. See table above for more info on the fields.
You need to send at least one of the setEmail events.

<!-- Criteo Product Tag -->
<script type="text/javascript">
  window.criteo_q = window.criteo_q || [];
  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
  window.criteo_q.push(
    { event: "setAccount", account: {{accountid}}},
    { event: "setEmail", email: "##Email Address of User##" },
    { event: "setEmail", email: "##SHA256-hashed Email Address of User##", hash_method: "sha256" },
    { event: "setEmail", email: "##MD5-hashed Email Address of User##", hash_method: "md5" },
    { event: "setSiteType", type: deviceType},
    { event: "setZipcode", zipcode: "##Zip Code##" },
    { event: "viewItem", item: "##Product ID##" }
  );
</script>
<!-- END Criteo Product Tag -->

Example

<!-- Criteo Product Tag -->
<script type="text/javascript">
  window.criteo_q = window.criteo_q || [];
  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
  window.criteo_q.push(
    { event: "setAccount", account: {{accountid}}},
    { event: "setEmail", email: "79054025255fb1a26e4bc422aef54eb4...", hash_method: "sha256" },
    { event: "setSiteType", type: deviceType},
    { event: "setZipcode", zipcode: "12345" },
    { event: "viewItem", item: "a123" }
  );
</script>
<!-- END Criteo Product Tag -->

Add to Cart Tag

This tag helps flag users that add items to the cart. This is useful for having a complete abandon cart audience and not missing users who add to cart but don't visit the actual cart page.

Please fire this event after a user adds an item to the cart.

Field Overview Example Syntax Required
Email Address Email address in plain text (if allowed by the law in your country), sha256 hashed email address or MD5 hashed email address. 79054025255fb1a26e4bc422aef54eb4... - Plain text emails
- Sha256 and md5 hashed emails
Required
Hash Method The hashing method used for the email.
- Doesn't need to be included for plain text emails
- For sha265 hashed emails: "sha256"
- For md5 hashed emails: "md5"
sha256 String Required
Zip Code User's shipping address zip code. 12345 String Recommended
Product Id Unique id of the product a123 String Required
Price Unit price of the product 20 Double Required
Quantity The number of a specific item that the consumer added to their cart 2 Integer Required

Structure

Dynamically replace fields surrounded by ##. See table above for more info on the fields.
You need to send at least one of the setEmail events.

<!-- Criteo Add to Cart Tag -->
<script type="text/javascript">
  window.criteo_q = window.criteo_q || [];
  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
  window.criteo_q.push(
    { event: "setAccount", account: {{accountid}}},
    { event: "setEmail", email: "##Email Address of User##" },
    { event: "setEmail", email: "##SHA256-hashed Email Address of User##", hash_method: "sha256" },
    { event: "setEmail", email: "##MD5-hashed Email Address of User##", hash_method: "md5" },
    { event: "setSiteType", type: deviceType},
    { event: "setZipcode", zipcode: "##Zip Code##" },
    { event: "addToCart", item: [
      {id: "##Product Id##", price: "##Price##", quantity: "##Quantity##" }
    ]}
  );
</script>
<!-- END Criteo Add to Cart Tag -->

Example

<!-- Criteo Add to Cart Tag -->
<script type="text/javascript">
  window.criteo_q = window.criteo_q || [];
  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
  window.criteo_q.push(
    { event: "setAccount", account: {{accountid}}},
    { event: "setEmail", email: "79054025255fb1a26e4bc422aef54eb4...", hash_method: "sha256" },
    { event: "setSiteType", type: deviceType},
    { event: "setZipcode", zipcode: "12345" },
    { event: "addToCart", item: [
      {id: "a123", price: "20", quantity: "1" }
    ]}
  );
</script>
<!-- END Criteo Add to Cart Tag -->

Basket / Cart Tag

This tag helps flag users that visit the cart page. This is useful for having a complete abandon cart audience.

Please fire this event on the "cart" page of the site.

Field Overview Example Syntax Required
Email Address Email address in plain text (if allowed by the law in your country), sha256 hashed email address or MD5 hashed email address. 79054025255fb1a26e4bc422aef54eb4... - Plain text emails
- Sha256 and md5 hashed emails
Required
Hash Method The hashing method used for the email.
- Doesn't need to be included for plain text emails
- For sha265 hashed emails: "sha256"
- For md5 hashed emails: "md5"
sha256 String Required
Zip Code User's shipping address zip code. 12345 String Recommended
Product Id Unique id of the product a123 String Required
Price Unit price of the product 20 Double Required
Quantity The number of a specific item that the consumer has in their cart 2 Integer Required

Structure

Dynamically replace fields surrounded by ##. See table above for more info on the fields.
You need to send at least one of the setEmail events.

<!-- Criteo Basket / Cart Tag -->
<script type="text/javascript">
  window.criteo_q = window.criteo_q || [];
  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
  window.criteo_q.push(
    { event: "setAccount", account: {{accountid}}},
    { event: "setEmail", email: "##Email Address of User##" },
    { event: "setEmail", email: "##SHA256-hashed Email Address of User##", hash_method: "sha256" },
    { event: "setEmail", email: "##MD5-hashed Email Address of User##", hash_method: "md5" },
    { event: "setSiteType", type: deviceType},
    { event: "setZipcode", zipcode: "##Zip Code##" },
    { event: "viewBasket", item: [
      {id: "##Product Id##", price: "##Price##", quantity: "##Quantity##" }
       //add a line for each additional line in the basket
    ]}
  );
</script>
<!-- END Criteo Basket / Cart Tag -->

Example

<!-- Criteo Basket / Cart Tag -->
<script type="text/javascript">
  window.criteo_q = window.criteo_q || [];
  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
  window.criteo_q.push(
    { event: "setAccount", account: {{accountid}}},
    { event: "setEmail", email: "79054025255fb1a26e4bc422aef54eb4...", hash_method: "sha256" },
    { event: "setSiteType", type: deviceType},
    { event: "setZipcode", zipcode: "12345" },
    { event: "viewBasket", item: [
      {id: "a123", price: "20", quantity: "1" }
       //add a line for each additional line in the basket
    ]}
  );
</script>
<!-- END Criteo Basket / Cart Tag -->

Sales Tag

This tag records conversions that happened on site. This tag should fire for ALL conversion events regardless of attribution.

Please fire this event on the "thank you" page after a user has converted.

Field Overview Example Syntax Required
Email Address Email address in plain text (if allowed by the law in your country), sha256 hashed email address or MD5 hashed email address. 79054025255fb1a26e4bc422aef54eb4... - Plain text emails
- Sha256 and md5 hashed emails
Required
Hash Method The hashing method used for the email.
- Doesn't need to be included for plain text emails
- For sha265 hashed emails: "sha256"
- For md5 hashed emails: "md5"
sha256 String Required
Zip Code User's shipping address zip code. 12345 String Recommended
Transaction ID Confirmation or Order # 7654322 Integer. Unique ID Required
Product Id Unique id of the product a123 String Required
Price Unit price of the product 20 Double Required
Quantity The number of a specific item that the consumer has in their cart 2 Integer Required

Structure

Dynamically replace fields surrounded by ##. See table above for more info on the fields.
You need to send at least one of the setEmail events.

<!-- Criteo Sales Tag -->
<script type="text/javascript">
  window.criteo_q = window.criteo_q || [];
  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
  window.criteo_q.push(
    { event: "setAccount", account: {{accountid}}},
    { event: "setEmail", email: "##Email Address of User##" },
    { event: "setEmail", email: "##SHA256-hashed Email Address of User##", hash_method: "sha256" },
    { event: "setEmail", email: "##MD5-hashed Email Address of User##", hash_method: "md5" },
    { event: "setSiteType", type: deviceType},
    { event: "setZipcode", zipcode: "##Zip Code##" },
    { event: "trackTransaction", id: "##Transaction ID##", item: [
       {id: "##Product Id##", price: "##Price##", quantity: "##Quantity##" }
       //add a line for each additional line in the basket
     ]}
  );
</script>
<!-- END Criteo Sales Tag -->

Example

<!-- Criteo Sales Tag -->
<script type="text/javascript">
  window.criteo_q = window.criteo_q || [];
  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
  window.criteo_q.push(
    { event: "setAccount", account: {{accountid}}},
    { event: "setEmail", email: "79054025255fb1a26e4bc422aef54eb4...", hash_method: "sha256" },
    { event: "setSiteType", type: deviceType},
    { event: "setZipcode", zipcode: "12345" },
    { event: "trackTransaction", id: "7654322", item: [
       {id: "a123", price: "20", quantity: "1" }
       //add a line for each additional line in the basket
     ]}
  );
</script>
<!-- END Criteo Sales Tag -->

Verification

[[accurate]]