Say hello to Piwik!

Not to be creepy, but I want to know more about you. I’d like to know how you get to my site, what links you click on, etc… I promise I’m not doing this to keep tabs on you, I’m just trying to make my blog better for you.

The JetPack plugin for WordPress gives me some basic stats, but I need something a little more in-depth. I could use Google Analytics, but you can probably guess how I feel about that. I considered a few options:

Ultimately, I ended up going with Piwik. It’s open source, seems to have the most features, and seems to be the easiest for a newbie to setup. Initially, I thought it would be a super-simple install since BlueHost offers SimpleScripts. However, at the time of this writing, BlueHost (via SimpleScripts) is offering v2.0.3, while Piwik is currently at v.2.4.1. In fact, the Piwik team no longer suggests you install Piwik through SimpleScripts and advises you to install it manually. Turns out, that process is super-simple as well. Check it out below, if you’re interested.

Click Make Changes and you should see a message saying the user was added to the database.

Step 4 – FTP installation files

Next, you’ll need to unzip the Piwik file you downloaded and FTP the contents to your server. Typically, you’ll want to setup an “analytics” sub-directory under your public www directory (e.g., http://www.yourdomain.com/analytics/).

After you’ve FTPed the files, visit the link where you uploaded the installation files (e.g., http://www.yourdomain.com/analytics/). If everything worked, you should see the Piwik installation screen. Click Next.

Step 5 – System Check

Step 6 – Database information

Here, you’ll need to enter information about the Piwik database you created earlier. Click Next.

If you’re using BlueHost, the database and username fields need to be the full names, usually structured as BlueHostUserName_PiwikDBName (e.g., logan_testdb) and BlueHostUserName_PiwikDBUser (e.g., logan_piwik).

Step 7 – Create super user

Next, you’ll create a super user account to login to Piwik the first time. Click Next.

Step 8 – Setup your website

Enter the information about your website. Click Next.

Step 9 – Get your JavaScript tracking tag

Creepier than it sounds. This tag needs to go into the bottom of all of your pages, or preferably, into the footer file of your theme. There is a Piwik plugin you can use to do this, or you can follow below where I’ll be putting it into my footer.php file. Click Next.

Step 10 – Login

That’s it! Click Continue to Piwik and then sign into Piwik with your super user credentials.

Step 11 – Insert tracking tag

This is really as easy as it sounds. First off, make sure you’re using child themes. Then, from your WordPress dashboard, head to Appearance, then Editor, then select Footer.php from the right-hand menu. Scroll down to the bottom and add your Piwik tracking tag right before </body>.