Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
in Q2A Core by
I try to include the piwik-tracking-code and I don`t know, how. Can you help me?
Q2A version: 1.5

2 Answers

0 votes
You can add custom HTML in your pages via the 'Layout' section of the admin panel.
Thanks Gid.  It works splendidly.
0 votes
If you want to also track by logged in user put the following by Admin/Layout/Custom HTML on the Bottom of page. Just replace yoursite, with your actual site.

<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  (function() {
    var u="//yoursite.com/piwik/";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', 1]);
var x=document.getElementsByClassName('qam-account-handle')[0];
 _paq.push(['setUserId',    x.innerHTML ]);
    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);
<noscript><p><img src="//yoursite.com/piwik/piwik.php?idsite=1&uid=" + document.getElementsByClassName('qam-account-handle')[0].innerHTML  style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->