1 (edited by Apple 10/11/2011 08:51:25 am)

Topic: Insert Piwik Tracking Code into FA

I copy and paste the Piwik tracking code into \includes\page\footer.inc.

The code was inserted just before line 41

echo "</body></html>\n";

However the footer is missing when I login into FA.

Can someone please give a helping hand.

Thanks

2 (edited by tclim 10/11/2011 10:03:39 am)

Re: Insert Piwik Tracking Code into FA

Hi Apple,

  You are rights, the place you inserted just before the line

  echo "</body></html>\n";

  I assume that your tracking code as below:

<script type="text/javascript">
try {
    var piwikTracker = Piwik.getTracker("http://URL_1/piwik.php", 1);
    piwikTracker.trackPageView();
    var piwik2 = Piwik.getTracker("http://URL_2/piwik.php", 4);
    piwik2.trackPageView();
} catch( err ) {}
</script>

But you cannot copy and paste into the footer.inc directly, it should be something like below:

echo '<script type="text/javascript">
    try {
        var piwikTracker = Piwik.getTracker("http://URL_1/piwik.php", 1);
        piwikTracker.trackPageView();
        var piwik2 = Piwik.getTracker("http://URL_2/piwik.php", 4);
        piwik2.trackPageView();
    } catch( err ) {}
    </script> ';
   
    echo "</body></html>\n";

  Note:

    You must place the echo '   javascript here and end with '; Please try it.

  Cheers,

  tclim

Re: Insert Piwik Tracking Code into FA

Hi Mr Lim,

Thank you very much for your valuable advice. The footer is visible but Piwik shown not sign of visitor.
Do you have any ideas why this happen eventhough I did the necessary replacement on URL_1 and site ID based on your sample code.
Wish you can lend a helping again.

Thank you very much.

Re: Insert Piwik Tracking Code into FA

Hello Apple,

  I do not used Piwik in my code. I visit the site at piwik and copy the sample code just to show you how to render the JavaScript in FA. It must be used within the

   echo ' ...........javascript here ...........';

  You should copy your tracking code and put into the FA. But not using the sample code that I provide above. That was just to show you how to render the JavaScript. Sorry about that if I provide any misleading information in this topic.

  Anyone who use the Piwik please help Apple to resolved the problem. Thanks You.

Cheers,

  tclim

5 (edited by Apple 10/12/2011 10:44:49 am)

Re: Insert Piwik Tracking Code into FA

Hello Mr Lim,

Please don't feel sorry about this.  I really appreciate your help from the bottom of my heart. Thank you very much again.