Trip Packages Booking site

A guide to implement Criteo OneTag solution directly in your source code of your trip packages booking site.

Overview

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

  1. Loader Script

  2. Homepage Tag

  3. Search Results Tag

  4. Product Tag

  5. Basket / Cart Tag

  6. Sales Tag

[[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, plese build a product feed matching the Criteo Feed Specification.

Tags

Loader Script

Please place the script below in the head of your site so that it fires on all pages. This will allow the Criteo tags to function.

<!-- 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

This event will be automatically fired on all the pages containing the OneTag loader if no previous event has been fired when the page is closed. This mechanism allow to capture all the website traffic and to compute the real landing rate and bounce rate of your campaigns. If you chose to add this tag manually instead of relying on the mechanism above, install the following tag on any page that is not tagged with any of the below tags.

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

Structure

Dynamically replace fields surrounded by ##. See description and 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: "##Email Address##" }, 
 { event: "setSiteType", type: deviceType },
 { 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" },
 { event: "setSiteType", type: deviceType },
 { event: "viewPage" });
</script> 
<!-- END Criteo Visit Tag -->

Homepage Tag

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

Field Overview Example Syntax
Email Address 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">
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##" },
 { event: "setSiteType", type: deviceType },
 { event: "viewHome" });
</script>
<!-- END Criteo Home Page 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" },
 { event: "setSiteType", type: deviceType },
 { event: "viewHome" });
</script>
<!-- END Criteo Home Page Tag -->

Search Results Tag

Install the following tag on the search results page of your site. Example URL: {{homepageurl}}/category?id=categoryid1

Field Overview Example Syntax
Email Address Plain-text or MD5 Hash 79054025255fb1a26e4bc422aef54eb4 String. Trimmed and lowercase 32 character, encoded in UTF-8
Checkin date Departure Date: Info "{{checkindate}}" "YYYY-MM-DD"
Checkout date Return Date: Info "{{checkoutdate}}" "YYYY-MM-DD"
Trip Packages ID Unique id of trip packages Trip PackagesID_1 Alphanumeric identifier of the trip packages

Structure

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

<!-- Criteo Search Results 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##" },
 { event: "setSiteType", type: deviceType },
 { event: "viewSearch", checkin_date: "##YYYY-MM-DD##", checkout_date: "##YYYY-MM-DD##" },
 { event: "viewList", item: ["##Trip Packages ID 1##", "##Trip Packages ID 2##", "##Trip Packages ID 3##"] });
</script>
<!-- END Criteo Search Results Tag -->

Example

<!-- Criteo Search Results 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" },
 { event: "setSiteType", type: deviceType },
 { event: "viewSearch", checkin_date: "{{checkindate}}", checkout_date: "{{checkoutdate}}" },
 { event: "viewList", item: ["Trip PackagesID_1", "Trip PackagesID_2", "Trip PackagesID_3"] });
</script>
<!-- END Criteo Search Results Tag -->

Product Tag

Install the following tag on the product detail pages of your website. Example URL: {{homepageurl}}/product?id=productid_1

Field Overview Example Syntax
Email Address Plain-text or MD5 Hash 79054025255fb1a26e4bc422aef54eb4 String. Trimmed and lowercase 32 character, encoded in UTF-8
Checkin date Departure Date: Info "{{checkindate}}" "YYYY-MM-DD"
Checkout date Return Date: Info "{{checkoutdate}}" "YYYY-MM-DD"
Trip Packages ID Unique id of trip packages Trip PackagesID_1 Alphanumeric identifier of the trip packages

Structure

Dynamically replace fields surrounded by ## with users information. See 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: "##Email Address##" },
 { event: "setSiteType", type: deviceType},
 { event: "viewSearch", checkin_date: "##YYYY-MM-DD##", checkout_date: "##YYYY-MM-DD##" },
 { event: "viewItem", item: "##Trip Packages 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" },
 { event: "setSiteType", type: deviceType },
 { event: "viewSearch", checkin_date: "{{checkindate}}", checkout_date: "{{checkoutdate}}" },
 { event: "viewItem", item: "Trip PackagesID_1" });
</script>
<!-- END Criteo Product Tag -->

Basket/Cart Tag

Install the following tag on the cart or basket page of your website. Example URL: {{homepageurl}}/cart

Field Overview Example Syntax
Email Address Plain-text or MD5 Hash 79054025255fb1a26e4bc422aef54eb4 String. Trimmed and lowercase 32 character, encoded in UTF-8
Checkin date Departure Date: Info "{{checkindate}}" "YYYY-MM-DD"
Checkout date Return Date: Info "{{checkoutdate}}" "YYYY-MM-DD"
Trip Packages ID Unique id of trip packages Trip PackagesID_1 Alphanumeric identifier of the trip packages
Price Total trip packages price 200.99 String or Integer, excluding the currency symbol
Quantity Static value 1 Integer

Structure

Dynamically replace fields surrounded by ## with users information. See 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: "##Email Address##" },
 { event: "setSiteType", type: deviceType},
 { event: "viewSearch", checkin_date: "##YYYY-MM-DD##", checkout_date: "##YYYY-MM-DD##" },
 { event: "viewBasket", item: [
    {id: "##Trip Packages ID 1##", price: ##Total Trip Price##, quantity: 1 }
    //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" },
 { event: "setSiteType", type: deviceType },
 { event: "viewSearch", checkin_date: "{{checkindate}}", checkout_date: "{{checkoutdate}}" },
 { event: "viewBasket", item: [
    {id: "Trip PackagesID_1", price: 200.99, quantity: 1 }
    //add a line for each additional line in the basket
]}
);
</script>
<!-- END Criteo Basket/Cart Tag -->

Sales 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 Address Plain-text or MD5 Hash 79054025255fb1a26e4bc422aef54eb4 String. Trimmed and lowercase 32 character, encoded in UTF-8
Checkin date Departure Date: Info "{{checkindate}}" "YYYY-MM-DD"
Checkout date Return Date: Info "{{checkoutdate}}" "YYYY-MM-DD"
Trip Packages ID Unique id of trip packages Trip PackagesID_1 Alphanumeric identifier of the trip packages
Price Total trip packages price 200.99 String or Integer, excluding the currency symbol
Quantity Static value 1 Integer
Transaction ID Confirmation or booking # 7654322 Integer. Unique ID

Structure

Dynamically replace fields surrounded by ## with users information. See 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: "##Email Address##" },
 { event: "setSiteType", type: deviceType },
 { event: "viewSearch", checkin_date: "##YYYY-MM-DD##", checkout_date: "##YYYY-MM-DD##" },
 { event: "trackTransaction", id: ##Transaction ID##, item: [
    {id: "##Trip Packages ID 1##", price: ##Total Trip Price##, quantity: 1 }
    //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" },
 { event: "setSiteType", type: deviceType },
 { event: "viewSearch", checkin_date: "{{checkindate}}", checkout_date: "{{checkoutdate}}" },
 { event: "trackTransaction", id: 7654322, item: [
    {id: "Trip PackagesID_1", price: 200.99, quantity: 1 }
    //add a line for each additional line in the basket
]}
);
</script>
<!-- END Criteo Sales Tag -->

Verification

[[accurate]]