Installing Piwik – Real Time Web Analytics – WordPress Joomla and Drupal

Tutorial on how to set up and install Piwik

Piwik is an open source easy to use web analytical tool which provides stats in real time and all the other bells and whistles of analytical reporting. The three key CMS players WordPress, Drupal and Joomla have plugins/module that get your site up and running in no time.

It’s easy to use, you control and manage the master site and tag your target sites with javascript code similar to Google Analytics, since this site is made in WordPress and Drupal I wanted a tool the covers both CMS systems and reports on figures outside of Google to show me what is going on – this is where Piwik comes in very handy.

To get the key master site for Piwik up and running, download the lastest version of Piwik here.

Extract the zip and ftp the “piwik” folder to your document root level – (if you can upload the zip and extract it from cPanel it will be a lot faster, and leave the piwik folder as below)

/public_html/piwik/

Next thing to do is create a MySQL database for Piwik, if you have a cPanel server, the quickest way is to use the database wizard.

database-wizard-cpanel

database-wizard-cpanel

Create the database name, database user, link the user to the database and grant all privileges.

database-user-all-privileges

database-user-all-privileges

Copy the names down of the db, dbuser and password as you’ll need them in the piwik installation process.

Browse to the piwik folder http://yourdomain/piwik

piwik-install

piwik-install

Follow the bouncing ball…..use the information you copied for the database settings, also a few additional fields need attention here:

- database server – it’s either going to be localhost or 127.0.0.1

- table-prefix – set to what you like

- adapter – PDO_MYSQL works for me

 

piwik-database-settings

piwik-database-settings

Follow the bouncing ball a bit further setting up an admin user and entering your first trackable site which gives you the javascript code to insert to the pages.

And finally you get to the login page. – Success

piwik-login page

piwik-login page

After login you are then faced with the “Dashboard” and as soon as your web visitors arrive you can see them in the real time widget.

To add additional websites for tracking, go to “Settings”, then the tab “Websites” and “Add a new website” and fill in the required fields.

add-website-piwik-tracking-id

add-website-piwik-tracking-id

Each website you enter gets its unique id, it’s not like a Google UA No., it simply starts from 1 and increases in 1 digit increments.

To see the actual tracking code click on the right most column.

tracking-code-piwik

tracking-code-piwik

Some websites can utilise just the ID number to extract and insert the tracking code with the help of plugins or modules otherwise paste the tracking code manually into your site and watch the numbers start to come in.

If you want to have the Piwik directory all in https you need to tweak the config file, open ‘config.ini.php’:

/public_html/piwik/config/config.ini.php

add in at the end:

[General]
force_ssl_login=1

Thats it as long as your server has SSL set up it will work – forcing the directory with htaccess to SSL will not bring across page information and keywords from your targetted sites.

WordPress

To get the code easily into WordPress use the Piwik plugin here, upload to your plugins folder, activate and enter your settings, like so;

wordpress-piwik-plugin-install

wordpress-piwik-plugin-install

The key thing is to get the ID Number in and master hostname of Piwik Server and the plugin does the rest.

Drupal

For Drupal get the Piwik module here. Configure it via “Admin > Configuration > System > Piwik”

drupal-piwik-module-install

drupal-piwik-module-install


Again the importance is on the ID and the Piwik Server URL, there’s also a whole bunch of config options at the bottom.

Joomla

Get the 1.7 Joomla extension here, enable it and add in the tracking script code generated from Piwik for the site in question.

piwik-joomla-module

piwik-joomla-module

Thats it happy Piwiking!

 

Related posts:

  1. Fastest Way of Installing Drupal 6 on Mac OS X
  2. Fastest Way of Installing Drupal 7.14 on Mac OS X 10.7 , 10.6
  3. How to Migrate Drupal Site to a local Development Server & Fix Clean URLs
  4. Sort out your Canonical URLs in Drupal – Force http://www
  5. Change the Drupal Administration Appearance and Menu
  • John

    What a WONDERFUL tutorial. I looked everywhere trying to see how to properly install Piwik and this is the clearest, most concise, tutorial on the web. Thanks SO much.

    • http://coolestguyplanettech.com Neil Gee

      Appreciate the reply!

      • Lazab2011

        I keep getting this error http://awesomescreenshot.com/086phz409

        I have uploaded in binary mode and I still receive that error.

  • http://coolestguyplanettech.com Neil Gee

    what type of site are you getting data from, is it WordPress? Are you using a plugin? I would check the settings on the site first – be careful on setting 777 permissions, not very secure.

  • http://twitter.com/ScopeATL Scope Atlanta

    Sorry for having a duplicate post but here is the screenshot to the problem I am having with my piwik intall. I uploaded in binary mode and I am till having problems :(

    • http://coolestguyplanettech.com Neil Gee

      best thing to do here if you are trying in binary mode and it still throws the error is to upload the whole folder compressed in zip or tar format and uncompress when it is finished uploading, if you have a cpanel server use the file manager to accomplish

      • Anonymous

        Thank you. I was able to get it working.

  • Flor Terebck

    It worked! thanks!