Lead Generation

A guide to implement Criteo OneTag solution directly in your source code.

Overview

This tutorial will explain how to implement the Criteo OneTag solution directly in your source code. The Criteo OneTag should be placed in the header or body of each page on your site. Please implement the following 3 tags on your website:

  1. Homepage Tag

  2. Sign-up / Form Tag

  3. Conversion Tag

[[disclaimer-developer]]

Tags

Homepage Tag

Install the following tag on the homepage of your website. Example URL: {{homepageurl}}

Field Overview Example Syntax
email Plain-text or MD5 Hash 79054025255fb1a26e4bc422aef54eb4 String. Trimmed and lowercase 32 character, encoded in UTF-8

Structure

Dynamically replace fields surrounded by ## with users information. See Example

<!-- Criteo Homepage Tag -->
<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 || [];
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}}}, // You should never update this line
 { event: "setEmail", email: "##Email Address of user##" }, // Can be an empty string 
 { event: "setSiteType", type: deviceType},
 { event: "viewHome"});
</script> 
<!-- END Criteo Home Page Tag -->

Example

<!-- Criteo Homepage Tag -->
<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 || [];
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}}}, // You should never update this line
 { event: "setEmail", email: "79054025255fb1a26e4bc422aef54eb4" }, // Can be an empty string 
 { event: "setSiteType", type: deviceType},
 { event: "viewHome"});
</script> 
<!-- END Criteo Home Page Tag -->

Sign-up / Form Tag

Install the following tag on each page of the sign-up form of your website. Example URL: {{homepageurl}}/sign-up/step1. If there is more than 1 page or step for the sign-up, you may add the user_segment parameter to each tag, corresponding to the step in the form.

Field Overview Example Syntax
email Plain-text or MD5 Hash 79054025255fb1a26e4bc422aef54eb4 String. Trimmed and lowercase 32 character, encoded in UTF-8
CPA cost-per-lead/acquisition/price {{cpa}} String or Integer, excluding the currency symbol
user_segment number of page or step in form. This is an optional field. 2 String or Integer

Structure

Dynamically replace fields surrounded by ## with users information. See Example

<!-- Criteo Sign-up / Form Tag -->
<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 || [];
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}}}, // You should never update this line
 { event: "setEmail", email: "##Email Address of user##" }, // Can be an empty string 
 { event: "setSiteType", type: deviceType},
 { event: "viewBasket", user_segment : ##Step Number##, item: [
    {id: "1", price: ##CPA##, quantity: 1 }
    //add a line for each additional line in the basket
]}
);
</script> 
<!-- END Sign-up / Form Tag -->

Example

<!-- Criteo Sign-up / Form Tag -->
<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 || [];
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}}}, // You should never update this line
 { event: "setEmail", email: "79054025255fb1a26e4bc422aef54eb4" }, // Can be an empty string 
 { event: "setSiteType", type: deviceType},
 { event: "viewBasket", user_segment : 2, item: [
    {id: "1", price: {{cpa}}, quantity: 1 }
    //add a line for each additional line in the basket
]}
);
</script> 
<!-- END Sign-up / Form Tag -->

Conversion Tag

Install the following tag on the sales confirmation or Thank You page of your website. Example URL: {{homepageurl}}/thankyou

Field Overview Example Syntax
email Plain-text or MD5 Hash 79054025255fb1a26e4bc422aef54eb4 String. Trimmed and lowercase 32 character, encoded in UTF-8
CPA cost-per-lead/acquisition/price {{cpa}} String or Integer, excluding the currency symbol
Transaction ID Confirmation or Order # 7654322 Integer. Unique ID

Structure

Dynamically replace fields surrounded by ## with users information. See Example

<!-- Criteo Conversion Tag -->
<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 || [];
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}}}, // You should never update this line
 { event: "setEmail", email: "##Email Address of user##" }, // Can be an empty string 
 { event: "setSiteType", type: deviceType},
 { event: "trackTransaction", id: ##Transaction ID##, item: [
    {id: "1", price: ##CPA##, quantity: 1 }
    //add a line for each additional line in the basket
]}
);
</script> 
<!-- END Criteo Conversion Tag -->

Example

<!-- Criteo Conversion Tag -->
<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 || [];
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}}}, // You should never update this line
 { event: "setEmail", email: "79054025255fb1a26e4bc422aef54eb4" }, // Can be an empty string 
 { event: "setSiteType", type: deviceType},
 { event: "trackTransaction", id: 7654322, item: [
    {id: "1", price: {{cpa}}, quantity: 1 }
    //add a line for each additional line in the basket
]}
);
</script> 
<!-- END Criteo Conversion Tag -->

OneTag 2.0

[[cname]]

Verification

[[accurate]]