Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
984 views
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
by
You can add custom HTML in your pages via the 'Layout' section of the admin panel.
by
Thanks Gid.  It works splendidly.
0 votes
by
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 || [];
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (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);
  })();
</script>
<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 -->

Welcome to the Q&A site for Question2Answer.

If you have a question about Q2A, please ask here, in English.

To report a bug, please create a new issue on Github or ask a question here with the bug tag.

If you just want to try Q2A, please use the demo site.

Categories

...