GTM - Criteo dataLayer for Hotel

A guide to implement Criteo dataLayer on hotel websites

Overview

The Criteo dataLayer is a javascript variable that needs to push all required information. This needs to be declared in the source code of each page on your site. For hotel websites, the Criteo dataLayer should be implemented on the following 5 page types:

  1. Homepage

  2. Search Result / Listing

  3. Product

  4. Basket / Cart

  5. Sales

[[disclaimer-developer]]

DataLayer

Homepage

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

Field Overview Example Syntax
event Page type event crto_homepage Static string value
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 dataLayer -->
<script type="text/javascript">
    var dataLayer = dataLayer || [];
    dataLayer.push({
        'event': 'crto_homepage',
        'crto': {
            'email': '##Users Email##' //can be empty string if email not known
        }
    });
</script>
<!-- END Criteo Homepage dataLayer -->

Example

<!-- Criteo Homepage dataLayer -->
<script type="text/javascript">
    var dataLayer = dataLayer || [];
    dataLayer.push({
        'event': 'crto_homepage',
        'crto': {
            'email': 'crtotest@test.com'
        }
    });
</script>
<!-- END Criteo Homepage dataLayer -->

Search Result / Listing

Install the following dataLayer on the search result and listing pages of your website. Example URL: {{homepageurl}}/find/hotels?from=2018-06-20&to=2018-06-25

Field Overview Example Syntax
event Page type event crto_listingpage Static string value
email Plain-text or MD5 Hash 79054025255fb1a26e4bc422aef54eb4 String. Trimmed and lowercase 32 character, encoded in UTF-8
Hotel IDs First 3 unique IDs of Hotel in the result page ['Hotel123', 'Hotel456', 'Hotel789'] String
din From or check-in date 2018-06-20 yyyy-MM-dd
dout To or check-out date 2018-06-25 yyyy-MM-dd
nbra Number of Adult 2 Integer
nbrc Number of Child 0 Integer
nbrr Number of Rooms 1 Integer

Structure

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

<script type="text/javascript">
    var dataLayer = dataLayer || [];
    dataLayer.push({
        'event': 'crto_listingpage',
        'crto': {
            'email': '##Users Email##', //can be empty string if email not known
            'din': 'yyyy-MM-dd',
            'dout': 'yyyy-MM-dd',
            'nbra': 2,
            'nbrc': 0,
            'nbrr': 1,
            'products': ['##Hotel ID 1##', '##Hotel ID 2##', '##Hotel ID 3##']
        }
    });
</script>
<!-- END Criteo Category / Listing dataLayer -->

Example

<!-- Criteo Category / Listing dataLayer -->
<script type="text/javascript">
    var dataLayer = dataLayer || [];
    dataLayer.push({
        'event': 'crto_listingpage',
        'crto': {
            'email': 'crtotest@test.com',
            'din': '2018-06-20',
            'dout': '2018-06-20',
            'nbra': 2,
            'nbrc': 0,
            'nbrr': 1,
            'products': ['Hotel123', 'Hotel456', 'Hotel789']
        }
    });
</script>
<!-- END Criteo Category / Listing dataLayer -->

Product

Install the following dataLayer on the product detail pages of your website. Example URL: {{homepageurl}}/hotel/hotel123?from=2018-06-20&to=2018-06-25

Field Overview Example Syntax
event Page type event crto_productpage Static string value
email Plain-text or MD5 Hash 79054025255fb1a26e4bc422aef54eb4 String. Trimmed and lowercase 32 character, encoded in UTF-8
products Unique ID of Hotel 'Hotel123' String
din From or check-in date 2018-06-20 yyyy-MM-dd
dout To or check-out date 2018-06-25 yyyy-MM-dd
nbra Number of Adult 2 Integer
nbrc Number of Child 0 Integer
nbrr Number of Rooms 1 Integer

Structure

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

<!-- Criteo Product dataLayer -->
<script type="text/javascript">
    var dataLayer = dataLayer || [];
    dataLayer.push({
        'event': 'crto_productpage',
        'crto': {
            'email': '##Users Email##', //can be empty string if email not known
            'din': 'yyyy-MM-dd',
            'dout': 'yyyy-MM-dd',
            'nbra': 2,
            'nbrc': 0,
            'nbrr': 1,
            'products': ["##Hotel ID 1##"]
        }
    });
</script>
<!-- END Criteo Product dataLayer -->

Example

<!-- Criteo Product dataLayer -->
<script type="text/javascript">
    var dataLayer = dataLayer || [];
    dataLayer.push({
        'event': 'crto_productpage',
        'crto': {
            'email': 'crtotest@test.com',
            'din': '2018-06-20',
            'dout': '2018-06-25',
            'nbra': 2,
            'nbrc': 0,
            'nbrr': 1,
            'products': ['Hotel123']
        }
    });
</script>
<!-- END Criteo Product dataLayer -->

Basket/Cart

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

Field Overview Example Syntax
event Page type event crto_basketpage Static string value
email Plain-text or MD5 Hash 79054025255fb1a26e4bc422aef54eb4 String. Trimmed and lowercase 32 character, encoded in UTF-8
Hotel ID Unique ID of Hotel 'Hotel123' String
din From or check-in date 2018-06-20 yyyy-MM-dd
dout To or check-out date 2018-06-25 yyyy-MM-dd
nbra Number of Adult 2 Integer
nbrc Number of Child 0 Integer
nbrr Number of Rooms 1 Integer
price Total hotel 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 dataLayer -->
<script type="text/javascript">
    var dataLayer = dataLayer || [];
    dataLayer.push({
        'event': 'crto_basketpage',
        'crto': {
            'email': '##Users Email##',  //can be empty string if email not known  
            'din': 'yyyy-MM-dd',
            'dout': 'yyyy-MM-dd',
            'nbra': 2,
            'nbrc': 0,
            'nbrr': 1,
            'products': [{
                'id': '##Hotel ID 1##',
                'price': '##Total hotel price##',
                'quantity': 1
            }] //add new object for each product added to cart.
        }
    });
</script>
<!-- END Criteo Basket/Cart dataLayer -->

Example

<!-- Criteo Basket/Cart dataLayer -->
<script type="text/javascript">
    var dataLayer = dataLayer || [];
    dataLayer.push({
        'event': 'crto_basketpage',
        'crto': {
            'email': 'crtotest@test.com',
            'din': '2018-06-20',
            'dout': '2018-06-25',
            'nbra': 2,
            'nbrc': 0,
            'nbrr': 1,
            'products': [{
                'id': 'Hotel123',
                'price': 200.99,
                'quantity': 1
            }]
        }
    });
</script>
<!-- END Criteo Basket/Cart dataLayer -->

Sales

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

Field Overview Example Syntax
event Page type event crto_transactionpage Static string value
email Plain-text or MD5 Hash 79054025255fb1a26e4bc422aef54eb4 String. Trimmed and lowercase 32 character, encoded in UTF-8
Hotel ID Unique ID of Hotel 'Hotel123' String
din From or check-in date 2018-06-20 yyyy-MM-dd
dout To or check-out date 2018-06-25 yyyy-MM-dd
nbra Number of Adult 2 Integer
nbrc Number of Child 0 Integer
nbrr Number of Rooms 1 Integer
price Total hotel price 200.99 String or Integer, excluding the currency symbol
quantity Static value 1 Integer
transactionid Confirmation or order # 7654322 Integer. Unique ID

Structure

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

<!-- Criteo Sales dataLayer -->
<script type="text/javascript">
    var dataLayer = dataLayer || [];
    dataLayer.push({
        'event': 'crto_transactionpage',
        'crto': {
            'email': '##Users Email##',  //can be empty string if email not known
            'din': 'yyyy-MM-dd',
            'dout': 'yyyy-MM-dd',
            'nbra': 2,
            'nbrc': 0,
            'nbrr': 1,
            'transactionid':'##Order Number##',
            'products': [{
                'id': '##Hotel ID 1##',
                'price': '##Total hotel price##',
                'quantity': 1
            }] //add new object for each product added to cart.
        }
    });
</script>
<!-- END Criteo Sales dataLayer -->

Example

<!-- Criteo Sales dataLayer -->
<script type="text/javascript">
    var dataLayer = dataLayer || [];
    dataLayer.push({
        'event': 'crto_transactionpage',
        'crto': {
            'email': 'crtotest@test.com',
            'din': '2018-06-20',
            'dout': '2018-06-25',
            'nbra': 2,
            'nbrc': 0,
            'nbrr': 1,
            'transactionid':'ORD00001',
            'products': [{
                'id': 'Hotel123',
                'price': 200.99,
                'quantity': 1
            }]
        }
    });
</script>
<!-- END Criteo Sales dataLayer -->

Download

Click to download Container

Import Container

[[import-gtm-container]]

OneTag 2.0

[[cname]]

Verification

[[accurate]]