Book Image

Piwik Web Analytics Essentials

By : Stephan A. Miller
Book Image

Piwik Web Analytics Essentials

By: Stephan A. Miller

Overview of this book

<p>Without web analytics, you are blind on the internet. In order to improve conversions and revenue on your web- site, you need to know what is going on. Piwik gives you this data and unlike Google Analytics, gives you total control over its usage. Unlike Google analytics where the data can be read by Google, Piwik maintains complete confidentiality of your website data. By harnessing the power of your tracked data, you can raise the conversion rates on your website to new heights.<br /><br />"Piwik Web Analytics Essentials" will show you how to install Piwik Open Source Analytics and have you tracking your website’s visitors within an hour after you pick up the book! After that, you will learn how to track custom events and programmatically trigger tracking events. The book continues with ecommerce tracking and advanced Piwik API usage.<br /><br />This book will take you from installing Piwik on your web server to writing custom tracking code for your apps.<br /><br />You will learn goal and event tracking techniques and how to add them to your standard tracking to fine tune your analytics results. Nothing is untrackable using Piwik: ecommerce shopping carts, web apps, phone apps, and more can make use of Piwik tracking capabilities.<br /><br />"Piwik Web Analytics Essentials" will walk you through every step with detailed screenshots and plenty of example code.</p>
Table of Contents (18 chapters)
Piwik Web Analytics Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

Securing Piwik


The data that Piwik collects from visitors comes with responsibility. You are now responsible for the privacy of your visitors. While this responsibility may not be as big as storing encrypted credit card numbers, still, it shouldn't be taken lightly. The developers that work on Piwik are dedicated to providing users with a secure and bug-free application. But there are a few things you can do to make your Piwik installation more secure. Most of these would apply to any PHP and MySQL application.

  • Use a separate MySQL database for Piwik: It is a good practice to do this with all of your databases. That way, if an attacker happens to be able to access one database, this database will not be linked to multiple applications.

  • Give your Piwik database its own username and password: The first thing a hacker might try is to use one set of credentials that work on all of your databases. Giving each database a separate username and password limits the damage an attacker can do. To learn more about MySQL best practices, please visit: http://dev.mysql.com/tech-resources/articles/mysql-administrator-best-practices.html.

  • Always access Piwik over SSL: With a standard HTTP connection, information is sent in plain text. This includes usernames and passwords. Choosing to always use the HTTPS connection guarantees that this data will be encrypted. This is a pretty simple process that gives a lot of added security.

    • Make sure your web server is configured to accept SSL requests. You can use a self-signed certificate, but a valid SSL certificate is recommended for a production installation of Piwik.

    • Find the section marked General in the config/config.ini.php file in your Piwik install folder and add force_ssl=1 underneath the General heading, as follows:

      [General]
      force_ssl=1
  • Restrict access to Piwik files: Only the piwik.js and the piwik.php files are required by external websites for tracking. You can use .htaccess to restrict the access of every other file in the Piwik installation to only those IP addresses you will be using to check your stats.

  • Keep backups: Regular backups will protect your data in case of a disaster. First make sure that your Piwik MySQL database is backed up. There are plenty of free scripts or downloadable software to back up MySQL databases. Any one that works, should do. The only file you have to worry about backing up is config.ini.php in the config folder of your Piwik installation. Back it up to your computer or another location, regularly. This is all you need to restore a Piwik installation if your current installation is ever damaged. To learn more about backing up your MySQL databases, please visit: http://dev.mysql.com/doc/refman/5.1/en/backup-methods.html.

  • Keep your system up-to-date: Your system is only as strong as its weakest link, and there are many links in its chain. Sometimes, software updates add features, but often these updates fix bugs and plug security holes. So, keeping Piwik, Apache, Linux, PHP, and MySQL up-to-date is an important part of the security of your Piwik installation.

  • Use the Piwik security plugin: Piwik comes with a SecurityInfo plugin that will test your installation for any security issues and return a recommendation report. This plugin is not activated by default. First, you must activate the plugin in the Piwik's Settings | Plugins menu. You can then view the SecurityInfo plugin by going to Settings | Security in the Piwik admin interface. Anything marked green in the report is in good condition. Anything red should be checked out and fixed, if possible. Yellow is somewhere between both extremes, but not a dire threat.

  • Use strong passwords: This is always a good practice. Another good practice is changing your passwords regularly. You can generate a strong password online at http://www.pctools.com/guides/password/.

  • Use SSH and secure FTP: This is another general good practice. This will encrypt your connection to your web server—so no one snooping on your connection can capture data in any readable form.