Ideasoft

Setup guide.

Overview

This guide explains the Criteo integration for the Ideasoft platform.

[[disclaimer-nonplugin]]

Generating the Criteo Product Feed

  1. Login to the Ideasoft admin panel

  2. Go to Entegrasyonlar > Idea Output Çıktı Sistemi > Yeni Çıktı Oluştur > Katalog Çıktısı (Integrations > Idea Output System > Create New Output > Catalog Output) menu option Yeni feed oluştur

  3. Under "Veri alanları" (Data fields), choose the options below. Please don't forget to rename data fields as specified in the screenshot.

    Sütun 1 Sütun 2 Sütun 3
    Ürün ID Ürün Döviz Kuru Ürün Detay Bilgisi
    Ürün Stok Kodu Stok Durumu Ürün Adresi
    Tam Ürün Adı Ürün Resmi 2 Kategori Ağacı
    Markası Ürün Resmi 3 TL Kuruna Çevrilmiş KDV Dahil Fiyat
    Barcode Ürün Resmi 4 TL Kuruna Çevrilmiş İndirimli Fiyat
    Standart Resim

    Feed seçenekleri

  4. In "Çıktı Formatı" (Output Format), choose XML output and specify the options below:

    Feed seçenekleri 2

  5. Save the XML output by selecting "Sadece kaydet" (Only save) option

  6. In the output list, click the "İzin Tanımla" (Define Permission) link for the output you have just created

    İzinler

  7. Click the "Ekle" (Add) button

    İzin ekleme

  8. Click "Kaydet" (Save) button without filling IP or email fields

    İzin kaydetme

  9. Copy the URL for the newly created permission

    Feed adresi

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

Criteo OneTag Setup

  1. Login to the Ideasoft admin panel

  2. Go to Ayarlar > S.E.O > Arama Motoru Servisleri (Settings > S.E.O > Search Engine Services) menu option

    İzleme kodları

  3. Backup the existing codes under all options

  4. Choose each of the options below, and copy the related JavaScript codes and save:

Anasayfa Takip Kodu (Homepage Tracking Code)

<script type="text/javascript">
  (function(window){window.ITracking={addScript:function(id,url,callback){if(document.querySelectorAll('script[id="'+id+'"]').length!=0){if(callback&&typeof callback==='function'){callback()}return}var script=document.createElement('script');script.type='text/javascript';script.async=true;script.src=url;script.setAttribute('id',id);script.onload=script.onreadystatechange=function(){if((!this.readyState||this.readyState=='complete')){if(callback&&typeof callback==='function'){callback()}}};var getFirstScriptTag=document.getElementsByTagName('script')[0];getFirstScriptTag.parentNode.insertBefore(script,getFirstScriptTag)},utils:{isMobile:function(){return(navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/iPhone|iPad|iPod/i)||navigator.userAgent.match(/Opera Mini/i)||navigator.userAgent.match(/IEMobile/i))},isObject:function(value){return value!==null&&typeof value==='object'},isUndefined:function(value){return typeof value==='undefined'},isDefined:function(value){return typeof value!=='undefined'}}}})(window);
  if("{email}".length > 7)
    window.criteoEmail = "{email}";
  else
    window.criteoEmail = window.criteoEmail || "";

  if(ITracking.utils.isMobile()) {
    window.criteoMobileVersion = true;
  }
</script>

Google Analytics & Remarketing Kodu

<script type="text/javascript">
  (function(window){window.ITracking={addScript:function(id,url,callback){if(document.querySelectorAll('script[id="'+id+'"]').length!=0){if(callback&&typeof callback==='function'){callback()}return}var script=document.createElement('script');script.type='text/javascript';script.async=true;script.src=url;script.setAttribute('id',id);script.onload=script.onreadystatechange=function(){if((!this.readyState||this.readyState=='complete')){if(callback&&typeof callback==='function'){callback()}}};var getFirstScriptTag=document.getElementsByTagName('script')[0];getFirstScriptTag.parentNode.insertBefore(script,getFirstScriptTag)},utils:{isMobile:function(){return(navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/iPhone|iPad|iPod/i)||navigator.userAgent.match(/Opera Mini/i)||navigator.userAgent.match(/IEMobile/i))},isObject:function(value){return value!==null&&typeof value==='object'},isUndefined:function(value){return typeof value==='undefined'},isDefined:function(value){return typeof value!=='undefined'}}}})(window);
  window.criteoMobileVersion = false;

  if(ITracking.utils.isMobile()) {
    window.criteoMobileVersion = true;
  }

  criteoHomepageAndListingTags = function() {
    var criteoDeviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";

    if("{email}".length > 7)
      window.criteoEmail = "{email}";
    else
      window.criteoEmail = window.criteoEmail || "";

    var isCriteoViewHome = function(){
      var pathArr = window.location.href.split('?')[0].split('/');
      var queryString = window.location.href.split('?')[1];
      var pathArrLength = (pathArr.length - 1);

      if(typeof queryString == 'undefined' || queryString == 'do=catalog/start' || window.location.href.split('?')[0] == window.location.origin + "/") {
        if(pathArr[pathArrLength] == '' || pathArr[pathArrLength] == 'index.php'){
          return true;
        }
      }

      return false
    }

    if(isCriteoViewHome()) {
      ITracking.addScript('criteo-tracking', '//static.criteo.net/js/ld/ld.js', function(){
        window.criteo_q = window.criteo_q || [];
        window.criteo_q.push(
          {event: "setAccount", account: {{accountid}}},
          {event: "setEmail", email: window.criteoEmail},
          {event: "setSiteType", type: criteoDeviceType},
          {event: "viewHome", ecpplugin: "ideasoft"});
      });
    }
    else {
      window.setTimeout(function() {
        var isCriteoViewListing = function(){
          return (document.getElementById("showLabelPageItems") != null || document.getElementById("product-list") != null);
        }

        var isCriteoViewProduct = function() {
          return (new RegExp(',PR-.*\.html').exec(window.location.href)) != null;
        }

        if(isCriteoViewListing()) {
          var criteoListedItems = function() {
            var listedItems = document.getElementsByClassName("_productItem") || [];
            var criteoList = [];

            for(var i=0; i<listedItems.length && i<3; i++) {
              criteoList.push(listedItems[i].id.split("_")[1]);
            }

            if(criteoList.length == 0) {
              listedItems = $("#product-list a") || [];

              for(var i=0; i<listedItems.length && i<3; i++) {
                var criteoProductId = listedItems[i].href.split("-");
                criteoProductId = criteoProductId[criteoProductId.length - 1];
                criteoProductId = criteoProductId.split(".")[0];

                criteoList.push(criteoProductId);
              }
            }

            return criteoList;
          }

          ITracking.addScript('criteo-tracking', '//static.criteo.net/js/ld/ld.js', function(){
            window.criteo_q = window.criteo_q || [];
            window.criteo_q.push(
              {event: "setAccount", account: {{accountid}}},
              {event: "setEmail", email: window.criteoEmail},
              {event: "setSiteType", type: criteoDeviceType},
              {event: "viewList", ecpplugin: "ideasoft", item: criteoListedItems()});
          });
        }
        else if(window.criteoMobileVersion && isCriteoViewProduct()) {
          ITracking.addScript('criteo-tracking', '//static.criteo.net/js/ld/ld.js', function(){
            try {
              var criteoProductId = document.location.href.split("-");
              criteoProductId = criteoProductId[criteoProductId.length - 1];
              criteoProductId = criteoProductId.split(".")[0];

              var 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 || [];
              window.criteo_q.push(
                {event: "setAccount", account: {{accountid}}},
                {event: "setEmail", email: window.criteoEmail},
                {event: "setSiteType", type: criteoDeviceType},
                {event: "viewItem", ecpplugin: "ideasoft", item: criteoProductId});
            } catch(err) {
              ;
            }
          });
        }
      }, 4000);
    }
  }


  window.setTimeout(function() {
    try {
      ream.events.addListener("onRouteNavigate", criteoHomepageAndListingTags);
      }
      catch(err) {
    }
  }, 2000);


  criteoHomepageAndListingTags();
</script>

Ürün Takip Kodu (Product Tracking Code)

<script type="text/javascript">
   (function(window){window.ITracking={addScript:function(id,url,callback){if(document.querySelectorAll('script[id="'+id+'"]').length!=0){if(callback&&typeof callback==='function'){callback()}return}var script=document.createElement('script');script.type='text/javascript';script.async=true;script.src=url;script.setAttribute('id',id);script.onload=script.onreadystatechange=function(){if((!this.readyState||this.readyState=='complete')){if(callback&&typeof callback==='function'){callback()}}};var getFirstScriptTag=document.getElementsByTagName('script')[0];getFirstScriptTag.parentNode.insertBefore(script,getFirstScriptTag)},utils:{isMobile:function(){return(navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/iPhone|iPad|iPod/i)||navigator.userAgent.match(/Opera Mini/i)||navigator.userAgent.match(/IEMobile/i))},isObject:function(value){return value!==null&&typeof value==='object'},isUndefined:function(value){return typeof value==='undefined'},isDefined:function(value){return typeof value!=='undefined'}}}})(window);
   ITracking.addScript('criteo-tracking', '//static.criteo.net/js/ld/ld.js', function(){
    var criteoDeviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";

    if("{email}".length > 7)
      window.criteoEmail = "{email}";
    else
      window.criteoEmail = window.criteoEmail || "";

    window.criteo_q = window.criteo_q || [];
    window.criteo_q.push(
      {event: "setAccount", account: {{accountid}}},
      {event: "setEmail", email: window.criteoEmail},
      {event: "setSiteType", type: criteoDeviceType},
      {event: "viewItem", ecpplugin: "ideasoft", item: "{productId}"});
  });
</script>

Sepet Takip Kodu (Basket Tracking Code)

<script type="text/javascript">
  (function(window){window.ITracking={addScript:function(id,url,callback){if(document.querySelectorAll('script[id="'+id+'"]').length!=0){if(callback&&typeof callback==='function'){callback()}return}var script=document.createElement('script');script.type='text/javascript';script.async=true;script.src=url;script.setAttribute('id',id);script.onload=script.onreadystatechange=function(){if((!this.readyState||this.readyState=='complete')){if(callback&&typeof callback==='function'){callback()}}};var getFirstScriptTag=document.getElementsByTagName('script')[0];getFirstScriptTag.parentNode.insertBefore(script,getFirstScriptTag)},utils:{isMobile:function(){return(navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/iPhone|iPad|iPod/i)||navigator.userAgent.match(/Opera Mini/i)||navigator.userAgent.match(/IEMobile/i))},isObject:function(value){return value!==null&&typeof value==='object'},isUndefined:function(value){return typeof value==='undefined'},isDefined:function(value){return typeof value!=='undefined'}}}})(window);
  var criteoBasketProducts = new Array();
  [loop_product]
    criteoBasketProducts.push({"id": "{productId}", "price": parseFloat(({productPrice} * (1 + ({productTax} / 100 ))).toFixed(2)), "quantity": "{productAmount}"});
  [/loop_product]

  ITracking.addScript('criteo-tracking', '//static.criteo.net/js/ld/ld.js', function(){
    var criteoDeviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";

    if("{email}".length > 7)
      window.criteoEmail = "{email}";
    else
      window.criteoEmail = window.criteoEmail || "";

    window.criteo_q = window.criteo_q || [];
    window.criteo_q.push(
    {event: "setAccount", account: {{accountid}}},
    {event: "setEmail", email: window.criteoEmail},
    {event: "setSiteType", type: criteoDeviceType},
    {event: "viewBasket", ecpplugin: "ideasoft", item: criteoBasketProducts });
  });
</script>

Google Sipariş Takibi Kodu (Google Order Tracking Code)

<script type="text/javascript">
  (function(window){window.ITracking={addScript:function(id,url,callback){if(document.querySelectorAll('script[id="'+id+'"]').length!=0){if(callback&&typeof callback==='function'){callback()}return}var script=document.createElement('script');script.type='text/javascript';script.async=true;script.src=url;script.setAttribute('id',id);script.onload=script.onreadystatechange=function(){if((!this.readyState||this.readyState=='complete')){if(callback&&typeof callback==='function'){callback()}}};var getFirstScriptTag=document.getElementsByTagName('script')[0];getFirstScriptTag.parentNode.insertBefore(script,getFirstScriptTag)},utils:{isMobile:function(){return(navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/iPhone|iPad|iPod/i)||navigator.userAgent.match(/Opera Mini/i)||navigator.userAgent.match(/IEMobile/i))},isObject:function(value){return value!==null&&typeof value==='object'},isUndefined:function(value){return typeof value==='undefined'},isDefined:function(value){return typeof value!=='undefined'}}}})(window);
  var criteoSaleProducts = new Array();
  [loop_product]
    criteoSaleProducts.push({"id": "{productId}", "price": parseFloat(({productPrice} * (1 + ({productTax} / 100 ))).toFixed(2)), "quantity": {productAmount}});
  [/loop_product]

  ITracking.addScript('criteo-tracking', '//static.criteo.net/js/ld/ld.js', function(){
    var criteoDeviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";

    if("{email}".length > 7)
      window.criteoEmail = "{email}";
    else
      window.criteoEmail = window.criteoEmail || "";

    window.criteo_q = window.criteo_q || [];
    window.criteo_q.push(
      {event: "setAccount", account: {{accountid}}},
      {event: "setEmail", email: window.criteoEmail},
      {event: "setSiteType", type: criteoDeviceType},
      {event: "trackTransaction", ecpplugin: "ideasoft", id: "{orderId}", item: criteoSaleProducts});
  });
</script>

NOTE: While adding the Criteo JavaScript codes in the Ideasoft admin panel, try not to break previously added codes. Due to some known problems with the Ideasoft platform, the '[loop_product]' structure is executed only once in basket and order tracking codes. If this structure was previously used for other purposes under these tracking codes, the newly added JavaScript codes wouldn't work (i.e. '[loop_product]' would be included as regular text in the HTML output). In this case, you can ask for help from Criteo to merge the codes under the two '[loop_product]' structures.

Verification

[[accurate]]