pwired Posted January 10, 2014 Share Posted January 10, 2014 I want to give piwik analytics a try. Does anyone have both experience with google analytics and piwik analytics ? Is one better than the other in performance and tracking ? Is it ok to extract the piwik zipfile to public_html/analytics/piwik/ ? Where can I best put the piwik java script tracking code in pw ? What a bummer, I just uploaded the latest piwik 2.0.2 - setup a database - start piwik and get the following error message: Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in /home/user/public_html/analytics/piwik/index.php on line 11 Found that you need at least PHP 5.3.2 Link to comment Share on other sites More sharing options...
cstevensjr Posted January 10, 2014 Share Posted January 10, 2014 Piwik is a tool that affords you the opportunity to own your analytical data. When you use Piwik, you are not sharing this information with anyone else. That, in itself, makes it preferable to using Google Analytics. The Piwik code has improved over the years and provides a great platform for tracking website visits. I've used Piwik since 2008 and have never had any problems with it. I run it on a dedicated server, however it can easily be run even on a shared hosting package. I would suggest that you have a SSL certificate for your Piwik website, to protect your analytical data from prying eyes. Piwik Code I typically use two entries per website (one for Javascript and one for noscript instances). Gettng the code to work in ProcessWire is very easy. I use the following code on every website that I monitor: <!-- Piwik --> <script type="text/javascript"> var _paq = _paq || []; _paq.push(["trackPageView"]); _paq.push(["enableLinkTracking"]); (function() { var u=(("https:" == document.location.protocol) ? "https" : "http") + "://www.yourpiwikinstall.com/piwik/"; _paq.push(["setTrackerUrl", u+"piwik.php"]); _paq.push(["setSiteId", "27"]); 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 --> <!-- Piwik Image Tracker --> <noscript> <img src="https://www.yourpiwikinstall.com/piwik/piwik.php?idsite=43&rec=1" style="border:0" alt="" /> </noscript> <!-- End Piwik --> This covers the Javascript and non-Javascript (noscript) entries in the Piwik database. In this example, the Javascript entry has an Piwik ID of 27. The noscript entry has a Piwik ID of 43. The code goes at the end in the body section right before the </body> closing tag. I put the code normally in a main.inc, main.php or _main.php file 3 Link to comment Share on other sites More sharing options...
cstevensjr Posted January 10, 2014 Share Posted January 10, 2014 If you're serious about using Piwik, I would strongly suggest reading two books on Piwik; Piwik Web Analytics Essentials by Stephan Miller (Oct 5, 2012) and Piwik Mastery: Complete Guide to Piwik: Part of the Computer Mastery Series by Jon A Griffin Jr (Feb 1, 2012) I got them both from Amazon. 1 Link to comment Share on other sites More sharing options...
Hari KT Posted January 11, 2014 Share Posted January 11, 2014 Piwik is awesome to track. I have installed piwik 1.0 and did something before for a project. For the current project I am also trying 2.0, which is far better. I can see various use cases with it. One of the good thing is you can call the piwik api, get the image or json and plot or change accordingly on our system. Update : If you don't have a server to manage or install piwik then will be good to go with google analytics. And in 2.0 installation, I didn't have any trouble also. 3 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now