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 Sales Confirmation page

Overview

For Criteo OneTag purposes, the Sales Confirmation page is that which is displayed to the user after they have completed a purchase on your site, normally showing them an order ID and a summary of the order.
The Criteo OneTag must be installed on the Sales Confirmation page to track the product bought by your users. Tracking what the user buys allows Criteo to optimize banner display so that products already bought by the user won't be shown on any banners that they see in future. Capturing this information will also allow you to measure the ROI on your Criteo banners.

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 your Sales Confirmation page you will have to dynamically pass the IDs, prices and quantities of the products purchased by the user, the transaction/order ID, the siteType and email parameters.

The Criteo OneTag implemented on a Sales Confirmation 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: "trackTransaction", id: "TRANSACTION ID", item: [
{ id: "FIRST PRODUCT ID",  price: FIRST PRODUCT UNIT PRICE,  quantity: FIRST PRODUCT QUANTITY },                                                                                  
{ id: "SECOND PRODUCT ID", price: SECOND PRODUCT UNIT PRICE, quantity: SECOND PRODUCT QUANTITY }                                                                     
/* add a line for each product in the user's basket */
]});
</script>

The trackTransaction event

The trackTransaction event is the Criteo OneTag specific event triggered when the tag is implemented on a Sales Confirmation page.

The transaction/order ID for the user's purchase has to be passed dynamically on the parameter ID (where it says TRANSACTION ID in the code example below).

For each product purchased by the user you have to pass the ID of the product, the product unit price and the quantity of the product; so if the user has purchased two instances of the same product the quantity will be 2.

trackTransaction event:

{ event: "trackTransaction", id: "TRANSACTION ID", item: [ 
{ id: "FIRST PRODUCT ID",  price: FIRST PRODUCT UNIT PRICE,  quantity: FIRST PRODUCT QUANTITY },
    { id: "SECOND PRODUCT ID", price: SECOND PRODUCT UNIT PRICE, quantity: SECOND PRODUCT QUANTITY }                                     
/* add a line for each product in the user's basket */


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

For prices with decimal values the decimal separator used must be a dot. Example 44.90.

Example:

If the user has purchased:

  • Two instances of the product ID A122 with unit price £44.90
  • One instance of the product ID F5532 with unit price £85.00

and the transaction/order ID for the purchase is G555999, the trackTransaction event will look like:

{ event: "trackTransaction", id: "G555999", item: [ 
{ id: "A122",  price: 44.90,  quantity: 2 },                                   
{ id: "F5532", price: 85.00, quantity: 1 }

setSiteType parameter

The setSiteType parameter is a dynamic parameter present in 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 setEmail parameter is a dynamic parameter 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 being 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 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. 

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

Example of hashed email address user@example.com:

setHashedEmail parameter

 { 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