KobiMaster

Setup guide.

Overview

This guide explains the Criteo integration for the KobiMaster platform.

[[disclaimer-nonplugin]]

Generating the Criteo Product Feed

  1. Login to the KobiMaster admin panel

  2. Go to Entegrasyonlar > XML Yayınla (Integrations > Publish XML) menu option Feed menu

  3. Under XML Yayın Detayı form (XML Feed Details), choose GoogleMerchant template, specify the options below and save:

    Feed options

  4. Under the Xml Yayınları (Xml Feeds) list, copy the link to the newly generated feed

    Feed options

  5. In the Criteo Integrate platform's Feed module, choose the Google Shopping feed option and use this URL

Criteo OneTag Setup

  1. Login to the KobiMaster admin panel

  2. Go to İçerik Yönetimi > Site Scriptleri (Content Management > Site Scripts) menu option

    Site scripts menu

  3. Add a new site script by clicking the Yeni Ekle (Add New) button

  4. Set the script position to Belge Sonu (End of Document), the page as Genel (General), mark it as Aktif (Active) and paste the code below:

    Script details

<script type="text/javascript" src="//static.criteo.net/js/ld/ld.js" async="true"></script>
<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";
    var criteoPartnerId = {{accountid}};
    var cleanUpTRChars = function(id) { return id.replace(/İ/g, "I").replace(/Ç/g, "C").replace(/Ğ/g, "G").replace(/Ö/g, "O").replace(/Ş/g, "S").replace(/Ü/g, "U").trim(); }
    var criteoEmail = "";

    var user = kmGetCurrentUserInfo();

    if(typeof user != "undefined" && user != null) {
        criteoEmail = user.Email;
    }

    if(typeof kmPageInfo == "undefined") {

        if($(".product-list-container").length == 0) {
            window.criteo_q.push(
                { event: "setAccount", account: criteoPartnerId},
                { event: "setEmail", email: criteoEmail},
                { event: "setSiteType", type: deviceType},
                { event: "viewHome", ecpplugin: "kobi"});
        }
    }
    else if(kmPageInfo.kmPageType == "category" || $(".item .product").length > 0) {
        // Criteo listing tag
        var listedItems = [];
        $(".item img:lt(3)").each(function() {
            try{
                var urlPieces = this.src.split("/");
                var productId = cleanUpTRChars(urlPieces[urlPieces.length - 1].split("_")[0]);

                listedItems.push(productId);
            }
            catch(ex) {}
        });

        if(listedItems.length > 0) {
            window.criteo_q.push(
                { event: "setAccount", account: criteoPartnerId},
                { event: "setEmail", email: criteoEmail},
                { event: "setSiteType", type: deviceType},
                { event: "viewList", ecpplugin: "kobi", item:listedItems});
        }
    }
    else if(kmPageInfo.kmPageType == "product") {    
        var productId = cleanUpTRChars(kmPageInfo.kmPageId);
        window.criteo_q.push(
            { event: "setAccount", account: criteoPartnerId},
            { event: "setEmail", email: criteoEmail},
            { event: "setSiteType", type: deviceType},
            { event: "viewItem", ecpplugin: "kobi", item: productId});
    }
    else if(kmPageInfo.kmPageType == "cart") {
        var cartItems = kmGetCartItems().Items;
        var criteoBasketItems = new Array();

        if(cartItems.length > 0) {
            for(var i=0; i < cartItems.length; i++) {
                var item = cartItems[i];
                var productId = cleanUpTRChars(item.SKU);
                var price = item.RowTotal.split(" ")[0];

                // If price contains comma, fix the number format
                if(price.indexOf(","))
                    price = price.replace(/\./g, "").replace(",", ".");

                price = parseFloat(price) / item.Quantity;

                criteoBasketItems.push({id: productId, price: price, quantity: item.Quantity})
            }

            window.criteo_q.push(
                { event: "setAccount", account: criteoPartnerId},
                { event: "setSiteType", type: deviceType},
                { event: "setEmail", email: criteoEmail},
                { event: "viewBasket", ecpplugin: "kobi", item: criteoBasketItems});
        }
    }
    else if(kmPageInfo.kmPageType == "purchase") {
        var criteoTransactionItems = new Array();

        if(kmTransItems.length > 0) {
            for(var i=0; i < kmTransItems.length; i++) {
                var item = kmTransItems[i];
                var productId = cleanUpTRChars(item.SKU);
                var price = parseFloat(item.price);

                criteoTransactionItems.push({id: productId, price: price, quantity: item.quantity})
            }

            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: criteoPartnerId},
                { event: "setSiteType", type: deviceType},
                { event: "setEmail", email: criteoEmail},
                { event: "trackTransaction", ecpplugin: "kobi", id: kmCurrentTrans.orderid, item: criteoTransactionItems});
        }
    }
</script>

OneTag 2.0

[[cname]]

Verification

[[accurate]]