T-Soft

Setup guide.

Overview

This guide explains the Criteo integration for the T-Soft platform.

[[disclaimer-nonplugin]]

Criteo Product Feed

  1. In the T-Soft platform, the product feed is automatically generated at the following address: {{homepageurl}}/xml/googleshopping.com.php
  2. 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 T-Soft admin panel

  2. Go to Ayarlar > İzleme Kodları (Settings > Tracking Codes) menu option

    Tracking codes menu

  3. Add a new tracking code by clicking the plus icon

    New tracking code

  4. Choose the following options in the popup window and paste the following code in the script pane:

    Criteo codes

<script type="text/javascript" src="//static.criteo.net/js/ld/ld.js" async="true"></script>
<script type="text/javascript">
    // Prepare Criteo related data
    criteoDeviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
    window.criteo_q = window.criteo_q || [];

    // Your Criteo Partner ID
    var criteoPartnerId = {{accountid}};

    if(PAGE_TYPE == "category") {
        var prodObj = PRODUCT_DATA;
        var products = [];

        if(products.length < 1 && prodObj != 'null'){
            for(var i=0;i<3;i++){
                if(typeof prodObj[i] != 'undefined'){
                    products[i] = prodObj[i].id;
                }
            }
        }

        window.criteo_q.push(
                {event: "setAccount", account: criteoPartnerId},
                {event: "setSiteType", type: criteoDeviceType},
                {event: "setEmail", email: MEMBER_INFO.MAIL},
                {event: "viewList", ecpplugin: "tsoft", item: products});

    }
    else if(PAGE_TYPE == "product") {
        // Prepare Criteo related data
        var criteoProductId = PRODUCT_DATA[0].id;
        window.criteo_q.push(
            {event: "setAccount", account: criteoPartnerId},
            {event: "setSiteType", type: criteoDeviceType},
            {event: "setEmail", email: MEMBER_INFO.MAIL},
            {event: "viewItem", ecpplugin: "tsoft", item: criteoProductId});
    }
    else if(PAGE_TYPE == "cart") {
        $.get("/srv/service/customer/get-basket", function(data, status) {
            var basketItems = JSON.parse(data);
            var criteoProducts = [];
            for (i = 0; i < basketItems.products.length; i++) {
                var basketProduct = basketItems.products[i];
            criteoProducts.push({id: basketProduct.identifier, price: basketProduct.price_sell, quantity: basketProduct.quantity});
            }
            if (status == "success" && criteoProducts.length > 0) {
                // Prepare Criteo related data
                window.criteo_q.push(
                    {event: "setAccount", account: criteoPartnerId},
                    {event: "setSiteType", type: criteoDeviceType},
                    {event: "setEmail", email: MEMBER_INFO.MAIL},
                    {event: "viewBasket", ecpplugin: "tsoft", item: criteoProducts});
            }
        });
    }
    else if(PAGE_TYPE == "approve") {
        $.get("/srv/service/customer/get-order", function(data, status) {
            if (status == "success") {
                // Prepare Criteo related data
                var orderDetails = JSON.parse(data);
                var criteoProducts = [];
                for (i = 0; i < orderDetails.products.length; i++) {
                    var saleProduct = orderDetails.products[i];
                    criteoProducts.push({id: saleProduct.identifier, price: saleProduct.price_sell, quantity: saleProduct.quantity});
                }
                window.criteo_q.push(
                    {event: "setAccount", account: criteoPartnerId},
                    {event: "setSiteType", type: criteoDeviceType},
                    {event: "setEmail", email: MEMBER_INFO.MAIL},
                    {event: "trackTransaction", ecpplugin: "tsoft", id: orderDetails.transaction, item: criteoProducts});
            }
        });
    }
    else {
        window.criteo_q.push(
            {event: "setAccount", account: criteoPartnerId},
            {event: "setSiteType", type: criteoDeviceType},
            {event: "setEmail", email: MEMBER_INFO.MAIL},
            {event: "viewHome", ecpplugin: "tsoft"});
    }
</script>

Verification

[[accurate]]