Knowledge base | mouseflow

Prestashop Integration

In Prestashop, there are two ways of installing the Mouseflow tracking code.

Use a Module to Insert the Code

You can insert the tracking code on your preferred pages by using a module such as ContentBox, which allows you to insert custom HTML/JavaScript on your site.

Simply install the module and add the tracking code (in source code mode). Hook the module to the block you prefer. If you want to record the entire page, you should insert the tracking code in a block that is shown on every page, such as displayFooter.

Insert the Tracking Code in a Template

You can also insert the tracking code directly inside a Prestashop template (.tpl file) by putting the JavaScript inside the {literal}{/literal} tags. For example:

<script type="text/javascript"> 
    {literal} 
    window._mfq = window._mfq || [];
    (function() { 
        var mf = document.createElement("script"); mf.type = "text/javascript"; mf.async = true; 
        mf.src = "//cdn.mouseflow.com/projects/your-website-id.js"; 
        document.getElementsByTagName("head")[0].appendChild(mf); 
    })(); 
    {/literal} 
</script>

To track all of the pages on your website, you should add the tracking code to a template file that is called on every page such as footer.tpl.