0

I have installed piwik in my Joomla page using nfrPiwik plugin in order to insert the JavaScript code in order to interact my Joomla page with piwik statistics.

However where can I find this code? Most specifically file which is the file from Joomla file which took the JavaScript code from nfrPiwik plugin

1

2 Answers 2

1

The files for the plugin are located in the following directory:

ROOT/plugins/system/piwik

The following file is the one that displays the parameter allowing you to add your tracking code:

ROOT/plugins/system/piwik/piwik.xml

However it does not store your tracking code. This is done in the database

1

The plugin you mention (nfrPiwik) simply places any code you add to the plugin settings right before the closing </body> tag on your website. I'm not sure what code you're looking for, your question is a little unclear, but here's how to add your tracking code:

  1. Locate your tracking code. It looks like this, and the Piwik website has a guide explaining the code:

    <!-- Piwik -->
    <script type="text/javascript">
    var _paq = _paq || [];
    (function(){ var u=(("https:" == document.location.protocol) ? "https://{$PIWIK_URL}/" : "http://{$PIWIK_URL}/");
    _paq.push(['setSiteId', {$IDSITE}]);
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['trackPageView']);
    _paq.push(['enableLinkTracking']);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.defer=true; g.async=true; g.src=u+'piwik.js';
    s.parentNode.insertBefore(g,s); })();
    </script>
    <!-- End Piwik Code -->
    

    In your tracking code, {$PIWIK_URL} would be replaced by your Piwik URL and {$IDSITE} would be replaced by the idsite of the website you are tracking in Piwik.

  2. Locate then nfrPiwik plugin in your plugin manager (Extensions - Plugin Manager)

  3. Paste your tracking code in the text field in the plugin settings, make sure the plugin is enabled, and save.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.