Welcome to the Kelkoo Group Customer Service

Magento integration

Magento 1

Implement the lead tag

Find and edit the right XML layout and add :

<reference name="head">
   <block type="core/text" name="kelkoo.lead.tag">
      <action method="setText">
           <![CDATA[<script type="text/javascript" src="https://s.kk-resources.com/leadtag.js"></script>]]>

Implement the conversion tag

Step 1: identify your template

Before to start it’s necessary identify which template you are using for Magento. To do that, open the root folder of your site by an FTP client and go into the folder web/app/design/frontend/

In this folder there are the templates installed. Usually are “base”, “default” and a third theme. The latter probably is yours.

Step 2: open the file of your thank you page

For example, if your template is “custom”. You should go to the directory


Clearly instead of “custom” you should have the name of your template.

At this path you’ll find the file “success.phtml”, that’s the file the we were looking for. Open it with your text editor (no word/wordpad/openoffice).

Step 3: find the order details

The file success.phtml changes from template to template, but we can assume that we won’t generate issues adding our code to the bottom of the file. Paste the code below at the end of the file

$orderObj = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
$_totalData =$orderObj->getData();

This code allows us to get the value of the two variables: the total order and the id of the order. Those variables should be used in our sales tracking code.

The variables are :

Total order : $_totalData[‘grand_total’]
Order ID : $this->getOrderId()

Step 4: insert the code

Right after the code added above we can add the Kelkoogroup script.

Kelkoogroup script
<script type="text/javascript">
    _kkstrack = {
      merchantInfo: [{ country:"COUNTRY", merchantId:"COM_ID" }],
      orderValue: '<?=$_totalData['grand_total'] ?>',
      orderId: '<?=$this->getOrderId() ?>',
      basket: []
    (function() {
      var s = document.createElement('script');
      s.type = 'text/javascript';
      s.async = true;
      s.src = 'https://s.kk-resources.com/ks.js';
      var x = document.getElementsByTagName('script')[0];
      x.parentNode.insertBefore(s, x);

As you can see, Kelkoo Sales Tracking requires a few details of the order.

    • GREEN VALUES are fixed (static) values to pass along in the tag;
      • COM_ID: This is the unique ID representing your shop within the Kelkoo system. Note that you can log into your Merchant Extranet account and directly use the JS tag generator that will automatically update the code with your COMID. You then just need to copy-paste the code generated and update the other values below.
      • COUNTRY  is the 2-letter country code for the country on which your products are listed on Kelkoo: : ‘at’ for Austria, ‘be’ for Belgium, ‘br’ for Brazil, ‘ch’ for Switzerland, ‘cz’ for Czech Republic, ‘de’ for Germany, ‘dk’ for Denmark, ‘es’ for Spain, ‘fi’ for Finland, ‘fr’ for France, ‘ie’ for Ireland, ‘it’ for Italy, ‘mx’ for Mexico, ‘nb’ for Flemish Belgium, ‘nl’ for Netherlands, ‘no’ for Norway, ‘pl’ for Poland, ‘pt’ for Portugal, ‘ru’ for Russia, ‘se’ for Sweden, ‘uk’ for United Kingdom, ‘us’ for United States.

Magento 2

Implement the lead tag

If you want to add Kelkoogroup leadtag without creating a module, you can add the following code on your active theme.

// YourTheme/Magento_Theme/layout/default_head_blocks.xml
<script src="https://s.kk-resources.com/leadtag.js" src_type="url"/>

Implement the conversion tag

  1. Under your magento installation create directory app/code/ if it’s missing
  2. go to /app/code
  3. Download Kelkoost_magento2-2.zip module for magento 2. (compatible for Magento 2.2 and 2.3)
  4. copy Kelkoost_magento2-2.tgz in directory /app/code
  5. extract Kelkoost_magento2-2.tgz
  6. check directory tree, you should have something similar to: /
    |- Block  
    |    |- Success.php  
    |- etc  
    |    |- di.xml  
    |    |- module.xml  
    |- registration.php  
    |- view  
    |    |- frontend  
    |    |     |-  layout  
    |    |     |     |- checkout_onepage_success.xml  
    |    |     |-  templates  
    |    |     |     |- checkout  
    |    |     |     |     |- success.phtml  

  7. Modify file app/code/Kelkoo/Modulekelkoost/view/frontend/templates/checkout/success.phtml to set the correct country and comid
  8. Enable kelkoost module :
    php bin/magento module:enable Kelkoo_Modulekelkoost
    php bin/magento setup:upgrade --keep-generated