Question

I'm adding a tracking code to a Magento 2 demo in Stores > Configuration > General > Design > Footer > Miscellaneous HTML. However, after clicking on "Save Config" the code is showing in the Misc. HTML box, but it doesn't show in the code before the body tag. I added it to a M1 website and it's working fine. How can I fix the issue?

Here's the code:

<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u="//shopgome.piwikpro.com/";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', 3]);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
  })();
</script>
<noscript><p><img src="//shopgome.piwikpro.com/piwik.php?idsite=3" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->

Thank you

Was it helpful?

Solution

I did some digging seems like the system setting design/footer/absolute_footer is not being referred anywhere in the code base, or any template file.

I have created a issue on github for this

Footer Miscellaneous HTML Not working

For now you can add the tracking code using:

General -> Design -> HTML Head -> Miscellaneous Scripts.

OTHER TIPS

Since Magento 2.1 Design settings was moved to Content/Design/Configuration

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top