Info
Content

How to integrate the CMP into a JTL Shop website?

Integrate the CMP-Code into JTL Shop

In order to intergate the ConsentManager.net CMP into your JTL Shop system please follow these steps:

  1. You will need to edit the *.tpl files of your current theme. Therefore login into your server via FTP and locate the template directory and the template that you are using. Usually this can be found at {root}/templates/[template-name]/
  2. In the theme you should find a folder layout and within this folder a file called header.tpl. Edit this file.
  3. In header.tpl search for <body
  4. After the <body .... > you will find a {/block}, insert the CMP code after this  {/block} enclosed in {literal} and {/literal} :

  5. Save the file.

Block Third-Party-Codes in JTL Shop

Once the CMP-Code is integrated into your JTL Shop you should also prepare other codes (e.g. Google Analytics) in order for the CMP to block them if necessary. Please follow these steps:

  1. In the same directory where you located the header.tpl you should find a file called footer.tpl. Edit this file.
  2. In footer.tpl search for google-analytics.com
  3. Change the lines as follows:

Old code:

...
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' === document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
...

New code:

...
ga.type = 'text/javascript';
ga.async = true;
ga.setAttribute('class','cmplazyload');
ga.setAttribute('data-cmp-vendor',"s26");
ga.setAttribute('data-cmp-src',('https:' === document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js');
s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
...

 

Back to top