Neto

A guide to implement Criteo solutions in Neto.

Overview

This tutorial will explain how to generate Google Shopping Feed and install Criteo OneTag on your Neto site.

[[disclaimer-nonplugin]]

Feed

Please provide Criteo with a Google Shopping Feed. This feed must include the product SKU. You can generate the feed in Neto, click here

Tags

Steps

1 Go to Setup & tools > All settings & tools > Custom Scripts neto_custom_scripts

2 Click Add New neto_add_new

3 Add the name as "Criteo OneTag"

4 Click Page Footer and copy the following OneTag script. Click Save

<!-- Begin Criteo OneTag -->
[%set [@crto_tag@]%]
<script type="text/javascript" src="//static.criteo.net/js/ld/ld.js" async="true"></script>
<script type="text/javascript">
(function() {
var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
var accountID = {{accountid}};
var crto_email = '[@user:email@]';
if (/<[a-z][\s\S]*>/i.test(crto_email)) {
  crto_email = '';
}
else {
  crto_email = crto_email;
}
window.criteo_q = window.criteo_q || [];
window.criteo_q.push(
    { event: "setAccount", account: accountID},
    { event: "setSiteType", type: deviceType},
    { event: "setEmail", email: crto_email, ecpplugin: "neto" });
})();
</script>
[%/set%]

[%set [@crto_home@]%]
<script type="text/javascript">
window.criteo_q.push(
    {event: "viewHome"});
</script>
[%/set%]

[%set [@crto_product@]%]
<script type="text/javascript">
window.criteo_q.push(
    {event: "viewItem", item: "[@sku@]"});
</script>
[%/set%]

[%set [@crto_listing@]%]
<script type="text/javascript">
var crto_listArray = [];
    $('.product-image').each(function(){
        crto_listArray.push($(this).attr('rel').replace('itmimg', ''))
    })
window.criteo_q.push(
    {event: "viewList", item: crto_listArray.slice(0, 3)});
</script>
[%/set%]

[%set [@crto_basket@]%]
[%cart_items%]
        [%param *header%]
    <script>
        var crto_basketArray= [];
        var crto_discount = [@discount_total@];
        [%/param%]
        [%param *body%]
           crto_basketArray.push({id: "[@sku@]", price: [@price@], quantity: [@qty@]});
        [%/param%]
        [%param *footer%]
        // if order has special discount
        if (crto_discount && crto_discount > 0) {
            // set price to 0
            crto_basketArray = crto_basketArray.map(function(item) {
                return {id: item.id, price: 0, quantity: item.quantity};
            });
            // add dummy product with grand total price (after discount)
            crto_basketArray.push({id: 'dummyproductid', price:[@grand_total@], quantity: 1});
        }
    </script>
        [%/param%]
[%/cart_items%]
<script type="text/javascript">
window.criteo_q.push(
    {event: "viewBasket", item: crto_basketArray});
</script>
[%/set%]

[%if [@config:current_page_type@] eq 'product'%]
    [@crto_tag@]
    [@crto_product@]
[%elseif [@config:current_page_type@] eq 'category' and [@form:rf@] eq 'kw'%]
    [@crto_tag@]
    [@crto_listing@]
[%elseif [@config:current_page_type@] eq 'category'%]
    [@crto_tag@]
    [@crto_listing@]
[%elseif [@config:current_page_type@] eq 'checkout' and [@CONFIG:GA_FUNNEL_VALUE@] eq '/purchase/shopping_cart.html'%]
    [@crto_tag@]
    [@crto_basket@]
[%elseif [@config:current_page_type@] eq 'checkout' and [@CONFIG:GA_FUNNEL_VALUE@] eq '/purchase/confirmation.html'%]
[%else%]    [@crto_tag@] [@crto_home@] [%/if%]
<!-- End Criteo OneTag -->

5 Click Purchase Confirmation (Thank You Page) and copy the following Sales OneTag script. Click Save

<!-- Begin Criteo Sales Tag -->
<script>
    var crto_saleArray= [];
    var crto_discount = [@discount_total@];
    var crto_orderID = '[@order_id@]';
    var crto_userEmail = '[@email@]';
    [%show_order id:'[@order_id@]'%]
        [%param *body%]
            crto_saleArray.push({id: '[@sku@]', price: [@price@], quantity: [@qty@]});
        [%/param%]
    [%/show_order%]
    // if order has special discount
    if (crto_discount && crto_discount > 0) {
        // set price to 0
        crto_saleArray = crto_saleArray.map(function(item) {
            return {id: item.id, price: 0, quantity: item.quantity};
        });
        // add dummy product with grand total price (after discount)
        crto_saleArray.push({id: 'dummyproductid', price:[@grand_total@], quantity: 1});
    }
</script>
<script type="text/javascript" src="//static.criteo.net/js/ld/ld.js" async="true"></script>
<script type="text/javascript">
(function() {
var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
var accountID = {{accountid}};
window.criteo_q = window.criteo_q || [];
window.criteo_q.push(
    { event: "setAccount", account: accountID},
    { event: "setSiteType", type: deviceType},
    { event: "setEmail", email: crto_userEmail},            
    { event: "trackTransaction", ecpplugin: "neto", id: crto_orderID, item: crto_saleArray});
})();
</script>
<!-- End Criteo Sales Tag -->

Verification

[[accurate]]