WordPress Integration with WP-Piwik – Analytics – Piwik

WordPress Integration with WP-Piwik – Analytics – Piwik

WP-Piwik is a WordPress plugin which integrates Piwik and WordPress. By using the Piwik API, WP-Piwik is able to include a summary statistics page to your WordPress dashboard as shown below:

WP-Piwik statistics

In addition to including your traffic stats, WP-Piwik can add the Piwik tracking code to your WordPress blog and even manage your WordPress network in Piwik:

WP-Piwik tracking settings

In this blog post I explain how you can configure WP-Piwik to get great Web Analytics for your wordpress website(s) or for your entire network of sites automatically. But first you need your Piwik server URL and your auth token.

The Piwik URL is the same URL you use to access your Piwik, e.g. http://demo.piwik.org is the demo site’s Piwik URL. Your auth token is some kind of a secret password, which allows WP-Piwik to fetch the necessary data from Piwik. To get your super user auth token, just click on the API link in your Piwik dashboard:

Piwik API link position

The token is stated in the box behind “&token_auth=” (the demo site’s super user auth token is “anonymous”, but yours should look like a strong of letters and numbers):

Piwik auth token position

Alternatively you can use a user account’s auth token (see Settings → Users) to restrict the plugin’s access to Piwik:

Piwik auth token by user

Keep in mind WP-Piwik needs more than view access to create new sites (admin user, or Super User token). If you use an auth token restricted to view access, you have to add your sites to Piwik manually.

Now you got all the information you need to configure WP-Piwik, next choose your type of use:

Use case 1) I just want to integrate Piwik and my single blog.

Put WP-Piwik into your plugins directory and activate it using your Plugins page. Now open the settings page (Settings → WP-Piwik) and enter your Piwik path and auth token:

Configure WP-Piwk

After saving your settings, WP-Piwik will automatically determine your site by its URL. If the site does not exist, WP-Piwik will create a new site – assumed that your auth token is not restricted to view access.

You want WP-Piwik to add the tracking code automatically? Open the Tracking tab and activate the Add tracking code option. That’s all!

Use case 2) I want to allow my WordPress network’s users to track their blog using their own Piwik setup.

If you operate a WordPress network and like to allow all your users to configure WP-Piwik with their own Piwik instance as described before, you have to install WP-Piwik as a site specific plugin. Put WP-Piwik into your plugins folder, but don’t activate it as a network plugin. Instead enable the Plugins page for individual site administrators from the Network Admin’s Settings → Network Settings menu:

Enable Plugins page

Now each site admin is able to activate and configure WP-Piwik on his own.

Use case 3) I want to provide an all-inclusive solution to my WordPress network’s users.

To run WP-Piwik as a fully automated feature of your WordPress network using a common Piwik instance you can activate it as a so-called network plugin. Put WP-Piwik in your plugins directory and activate it using the Network Admin’s plugin settings:

WP-Piwik network activation

Now you can configure WP-Piwik as described before, but you have to access WP-Piwik’s settings via Network Admin’s settings. All users can access their own statistics while the network admin is allowed to see all stats. (Please keep in mind WP-Piwik needs more than view access to create new network sites in Piwik automatically.)

Get Support for WP-Piwik

To get support or further information: