GTM - Criteo dataLayer for car rental

A guide to implement Criteo dataLayer on car rental 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 car rental websites, 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/car rentals?from=2018-06-20&to=2018-06-25

Field Overview Example Syntax
event Page type event crto_searchresultpage Static string value
email Plain-text or MD5 Hash 79054025255fb1a26e4bc422aef54eb4 String. Trimmed and lowercase 32 character, encoded in UTF-8
products Unique IDs of first 3 car rentals ['car rental123', 'car rental456', 'car rental789'] Array
din From or check-in date 2018-06-20 yyyy-MM-dd
dout To or check-out date. For one way car rental leave empty 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 Search Result dataLayer -->
<script type="text/javascript">
    var dataLayer = dataLayer || [];
    dataLayer.push({
        'event': 'crto_searchresultpage',
        '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': ['##car rental ID 1##', '##car rental ID 2##', '##car rental ID 3##']
        }
    });
</script>
<!-- END Criteo Search Result dataLayer -->

Example

<!-- Criteo Search Result dataLayer -->
<script type="text/javascript">
    var dataLayer = dataLayer || [];
    dataLayer.push({
        'event': 'crto_searchresultpage',
        'crto': {
            'email': 'crtotest@test.com',
            'din': '2018-06-20',
            'dout': '2018-06-20',
            'nbra': 2,
            'nbrc': 0,
            'nbrr': 1,
            'products': ['car rental123', 'car rental456', 'car rental789']
        }
    });
</script>
<!-- END Criteo Search Result 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 Car 'car rental123' 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': ["##Car 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': ['car rental123']
        }
    });
</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
din From or check-in date 2018-06-20 yyyy-MM-dd
dout To or check-out date. For one way car rental leave empty 2018-06-25 yyyy-MM-dd
nbra Number of Adult 2 Integer
nbrc Number of Child 0 Integer
nbrr Number of Rooms 1 Integer
id Unique ID of car rental 'car rental123' String
price Total car rental 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': '##car rental ID 1##',
                'price': '##Total car rental 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': 'car rental123',
                '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
din From or check-in date 2018-06-20 yyyy-MM-dd
dout To or check-out date. For one way car rental leave empty 2018-06-25 yyyy-MM-dd
nbra Number of Adult 2 Integer
nbrc Number of Child 0 Integer
nbrr Number of Rooms 1 Integer
id Unique ID of car rental 'car rental123' String
price Total car rental price 200.99 String or Integer, excluding the currency symbol
quantity Static value 1 Integer
transactionid Booking or reference number 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': '##car rental ID 1##',
                'price': '##Total car rental 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': 'car rental123',
                '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]]