GTM - Criteo dataLayer

A guide to implement Criteo dataLayer

Overview

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

  1. Homepage

  2. Category / 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 -->

Category / Listing

Install the following dataLayer on the listing, category, and search results pages of your website. Example URL: {{homepageurl}}/category?id=categoryid1

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
Product ID unique ID of Product ProductID_1 String

Structure

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

<!-- Criteo Category / Listing dataLayer -->
<script type="text/javascript">
    var dataLayer = dataLayer || [];
    dataLayer.push({
        event: "crto_listingpage",
        crto: {
            email: "##Users Email##", // can be empty string if email not known
            products: ["##Product ID 1##", "##Product ID 2##", "##Product 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",
            products: ["ProductID_1", "ProductID_2", "ProductID_3"]
        }
    });
</script>
<!-- END Criteo Category / Listing dataLayer -->

Product

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

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
Product ID unique ID of Product ProductID_1 String

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
            products: ["##Product 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",
            products: ["ProductID_1"]
        }
    });
</script>
<!-- END Criteo Product dataLayer -->

Basket/Cart

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

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
Product ID unique ID of Product ProductID_1 String
price unit price of product 200.99 String or Integer, excluding the currency symbol
quantity number of units added 2 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
            products: [{
                id: "##Product ID 1##",
                price: "##Product Unit Price##",
                quantity: "##Number of Units##"
            }] // 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",
            products: [{
                id: "ProductID_1",
                price: "200.99",
                quantity: "2"
            },
            {
                id:"ProductID_2",
                price: "50.00",
                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
Product ID unique ID of Product ProductID_1 String
price unit price of product 200.99 String or Integer, excluding the currency symbol
quantity number of units added 2 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
                transactionid: "##Order Number##",
                products: [{
                    id: "##Product ID 1##",
                    price: "##Product Unit Price##",
                    quantity: "##Number of Units##"
                }] // 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",
                transactionid: "ORD00001",
                products: [{
                    id: "ProductID_1",
                    price: "200.99",
                    quantity: "2"
                },
                {
                    id:"ProductID_2",
                    price: "50.00",
                    quantity: "1"
                }]
            }
        });
</script>
<!-- END Criteo Sales dataLayer -->

Download

Click to download Container

Import Container

[[import-gtm-container]]

OneTag 2.0

[[cname]]

Verification

[[accurate]]