Flight Booking site¶
A guide to implement Criteo OneTag solution directly in your source code of your flight booking site.
Overview¶
This tutorial will explain how to implement the Criteo OneTag solution directly in your source code of your flight booking site. The Criteo OneTag should be placed in the head and body of each page on your site. Please implement the following 5 tags on your website:
[[disclaimer-developer]]
Feed¶
Please provide your Criteo contact 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.
Tags¶
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 | Plain-text or sha256 Hashed email address. Please pass an empty string if the users email is unavailable. | 79054025255fb1a26e4bc422aef54eb4... | String. Trimmed, lowercase and UTF-8 encoded | Recommended |
Hash Method | The hashing method used for the email. Please put "none" for plaintext emails and "sha256" for sha265 hashed emails. | sha256 | String | Recommended |
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:
<!-- 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##", hash_method: "##Hash Method##" },
{ 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 | Plain-text or sha256 Hashed email address. Please pass an empty string if the users email is unavailable. | 79054025255fb1a26e4bc422aef54eb4... | String. Trimmed, lowercase and UTF-8 encoded | Recommended |
Hash Method | The hashing method used for the email. Please put "none" for plaintext emails and "sha256" for sha265 hashed emails. | sha256 | String | Recommended |
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:
<!-- 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##", hash_method: "##Hash Method##" },
{ 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 -->
Travel Search Tag¶
This tag should fire on search result pages after a user has expressed interest in a particular item (flight, train ride, car rental, etc..). It provides our engine with specifics about the customer's interests and items they might also be interested in.
Please fire this event on any search result page after a user has entered the details about the search.
Field | Overview | Example | Syntax | Required |
---|---|---|---|---|
Email Address | Plain-text or sha256 Hashed email address. Please pass an empty string if the users email is unavailable. | 79054025255fb1a26e4bc422aef54eb4... | String. Trimmed, lowercase and UTF-8 encoded | Recommended |
Hash Method | The hashing method used for the email. Please put "none" for plaintext emails and "sha256" for sha265 hashed emails. | sha256 | String | Recommended |
Zip Code | User's shipping address zip code. | 12345 | String | Recommended |
Flight ID | Unique id of the product. | a123 | String | Yes |
Checkin Date | Departure Date: Info | "{{checkindate}}" | "YYYY-MM-DD" | Recommended |
Checkout Date | Return Date: Info | "{{checkoutdate}}" | "YYYY-MM-DD" | Recommended |
Number of Adults | The number of adult passengers | 1 | Integer | Recommended |
Number of Children | The number of child passengers | 0 | Integer | Recommended |
Number of Infants | The number of infant passengers | 0 | Integer | Recommended |
Structure¶
Dynamically replace fields surrounded by ##. See table above for more info on the fields:
<!-- Criteo Search/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##", hash_method: "##Hash Method##" },
{ event: "setSiteType", type: deviceType},
{ event: "setZipcode", zipcode: "##Zip Code##" },
{ event: "viewSearch",
checkin_date: "##Checkin Date##",
checkout_date: "##Checkout Date##",
nbra: "##Number of Adults##",
nbrc: "##Number of Children##",
nbri: "##Number of Infants##"
},
{ event: "viewList", item: [
"##Flight ID 1##",
"##Flight ID 2##",
"##Flight ID 3##"
]}
);
</script>
<!-- END Criteo Search/listing Tag -->
Example¶
<!-- Criteo Search/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: "viewSearch",
checkin_date: "{{checkindate}}",
checkout_date: "{{checkoutdate}}",
nbra: "1",
nbrc: "0",
nbri: "0"
},
{ event: "viewList", item: [
"a123",
"b123",
"c123"
]}
);
</script>
<!-- END Criteo Search/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 | Plain-text or sha256 Hashed email address. Please pass an empty string if the users email is unavailable. | 79054025255fb1a26e4bc422aef54eb4... | String. Trimmed, lowercase and UTF-8 encoded | Recommended |
Hash Method | The hashing method used for the email. Please put "none" for plaintext emails and "sha256" for sha265 hashed emails. | sha256 | String | Recommended |
Zip Code | User's shipping address zip code. | 12345 | String | Recommended |
Flight ID | Unique id of the product. | a123 | String | Yes |
Checkin Date | Departure Date: Info | "{{checkindate}}" | "YYYY-MM-DD" | Recommended |
Checkout Date | Return Date: Info | "{{checkoutdate}}" | "YYYY-MM-DD" | Recommended |
Number of Adults | The number of adult passengers | 1 | Integer | Recommended |
Number of Children | The number of child passengers | 0 | Integer | Recommended |
Number of Infants | The number of infant passengers | 0 | Integer | Recommended |
Structure¶
Dynamically replace fields surrounded by ##. See table above for more info on the fields:
<!-- Criteo Search/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##", hash_method: "##Hash Method##" },
{ event: "setSiteType", type: deviceType},
{ event: "setZipcode", zipcode: "##Zip Code##" },
{ event: "viewSearch",
checkin_date: "##Checkin Date##",
checkout_date: "##Checkout Date##",
nbra: "##Number of Adults##",
nbrc: "##Number of Children##",
nbri: "##Number of Infants##"
},
{ event: "viewItem", item: "##Flight ID##" }
);
</script>
<!-- END Criteo Search/product Tag -->
Example¶
<!-- Criteo Search/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: "viewSearch",
checkin_date: "{{checkindate}}",
checkout_date: "{{checkoutdate}}",
nbra: "1",
nbrc: "0",
nbri: "0"
},
{ event: "viewItem", item: "a123" }
);
</script>
<!-- END Criteo Search/product 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 | Plain-text or sha256 Hashed email address. Please pass an empty string if the users email is unavailable. | 79054025255fb1a26e4bc422aef54eb4... | String. Trimmed, lowercase and UTF-8 encoded | Recommended |
Hash Method | The hashing method used for the email. Please put "none" for plaintext emails and "sha256" for sha265 hashed emails. | sha256 | String | Recommended |
Zip Code | User's shipping address zip code. | 12345 | String | Recommended |
Flight ID | Unique id of the product | a123 | String | Yes |
Price | Unit price of the product | 20 | Double | Yes |
Quantity | The number of a specific item that the consumer has in their cart | 2 | Integer | Yes |
Checkin Date | Departure Date: Info | "{{checkindate}}" | "YYYY-MM-DD" | Recommended |
Checkout Date | Return Date: Info | "{{checkoutdate}}" | "YYYY-MM-DD" | Recommended |
Number of Adults | The number of adult passengers | 1 | Integer | Recommended |
Number of Children | The number of child passengers | 0 | Integer | Recommended |
Number of Infants | The number of infant passengers | 0 | Integer | Recommended |
Structure¶
Dynamically replace fields surrounded by ##. See table above for more info on the fields:
<!-- 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##", hash_method: "##Hash Method##" },
{ event: "setSiteType", type: deviceType},
{ event: "setZipcode", zipcode: "##Zip Code##" },
{ event: "viewSearch",
checkin_date: "##Checkin Date##",
checkout_date: "##Checkout Date##",
nbra: "##Number of Adults##",
nbrc: "##Number of Children##",
nbri: "##Number of Infants##"
},
{ event: "viewBasket", item: [
{
id: "##Flight 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: "viewSearch",
checkin_date: "{{checkindate}}",
checkout_date: "{{checkoutdate}}",
nbra: "1",
nbrc: "0",
nbri: "0"
},
{ event: "viewBasket", item: [
{
id: "a123",
price: "153.25",
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 | Plain-text or sha256 Hashed email address. Please pass an empty string if the users email is unavailable. | 79054025255fb1a26e4bc422aef54eb4... | String. Trimmed, lowercase and UTF-8 encoded | Recommended |
Hash Method | The hashing method used for the email. Please put "none" for plaintext emails and "sha256" for sha265 hashed emails. | sha256 | String | Recommended |
Zip Code | User's shipping address zip code. | 12345 | String | Recommended |
Transaction ID | Confirmation or Order # | 7654322 | Integer. Unique ID | Yes |
Deduplication | Indicates if the client attributed the sale to Criteo. Even if you put a 1, we will only attribute the sale if it matches our normal attribution model. Set to 1 if yes, else 0 | 1 | Boolean | No |
New Customer | Indicates if it is the first time that the user has bought a product on your site. Set to 1 if yes, else 0 | 1 | Boolean | No |
Flight ID | Unique id of the product | a123 | String | Yes |
Price | Unit price of the product | 20 | Double | Yes |
Quantity | The number of a specific item that the consumer has in their cart | 2 | Integer | Yes |
Checkin Date | Departure Date: Info | "{{checkindate}}" | "YYYY-MM-DD" | Recommended |
Checkout Date | Return Date: Info | "{{checkoutdate}}" | "YYYY-MM-DD" | Recommended |
Number of Adults | The number of adult passengers | 1 | Integer | Recommended |
Number of Children | The number of child passengers | 0 | Integer | Recommended |
Number of Infants | The number of infant passengers | 0 | Integer | Recommended |
Structure¶
Dynamically replace fields surrounded by ##. See table above for more info on the fields:
<!-- 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##", hash_method: "##Hash Method##" },
{ event: "setSiteType", type: deviceType},
{ event: "setZipcode", zipcode: "##Zip Code##" },
{ event: "viewSearch",
checkin_date: "##Checkin Date##",
checkout_date: "##Checkout Date##",
nbra: "##Number of Adults##",
nbrc: "##Number of Children##",
nbri: "##Number of Infants##"
},
{ event: "trackTransaction",
id: "##Transaction ID##",
new_customer: ##New Customer##,
deduplication: ##Deduplication##,
item: [
{
id: "##Flight 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: "viewSearch",
checkin_date: "{{checkindate}}",
checkout_date: "{{checkoutdate}}",
nbra: "1",
nbrc: "0",
nbri: "0"
},
{ event: "trackTransaction",
id: "7654322",
new_customer: 0,
deduplication: 1,
item: [
{
id: "a123",
price: "153.25",
quantity: "1"
}
//add a line for each additional line in the basket
]}
);
</script>
<!-- END Criteo Sales Tag -->
Verification¶
[[accurate]]