The advantage in this method is the privacy you get for your data. But it requires decent resources on your server. So Piwik now came with a cloud solution called Piwik Pro. Of course it is a premium tool with a cost. The cost depends on the number of actions that take place on your website. Action can be any server call to the Piwik Server. Fortunately it comes with a 30 day free trial.
Piwik Pro + Google Tag Manager
Let’s see how to install Piwik Pro on your website. For this we will be using Google Tag Manager. Google Tag Manager is a free Tag Management solution provided by Google. I will be writing soon on how to install Google Tag Manager on your website. In my guides I will be using one of my websites called Storygag.com for demonstration.
Set up Piwik Pro account
Sign up for a Piwik pro free trial account by visiting this link
On the final step you can configure some important settings related to user’s privacy. Choose these options carefully depending upon the country where you are operating from. If your country’s law doesn’t prevent you from collecting IP addresses, you can go ahead and uncheck this box.
Creating a new tag in Google Tag Manager
Now that we have the tracking code with us, open Google Tag Manager. Create a new tag.
Publishing the changes of Piwik in Google Tag Manager
That’s all, save the tag. Publish your changes by clicking the Publish button on the top. You have successfully placed the Piwik on your website. You should start seeing the data on your Piwik dashboard
Snapshot of Piwik Dashboard
Below is a snapshot of the Piwik dashboard. Piwik provides real time visitor log as well. This is a nice way to know whether your code has been placed properly or not.
Piwik Custom Event Tracking using Google Tag Manager
Now that we have installed the base tag, it’s time for us to do some custom tracking. Let’s see one example on how to track a custom link.
Create a Click Listener in Google Tag Manager
Add a new tag on Google Tag Manager. Select the tag type as “Click Listener”. Select the firing conditions as “All Pages”. Now your click listener listens to all the clicks that are happening on your website.
Create a custom HTML tag for Piwik Event Tracking
Now create another Custom HTML Tag. Paste the below code in the configure tag section. Select the Firing rules as “Click”
_paq.push(['trackEvent','Link','Click','Home Page Carousel']);
Configuring the Trigger
Now create the trigger for the Home page carousel link tracking. Select the configuration as shown in the below screenshot. Select all elements in configure trigger section and select the firing rules.
We are tracking home page carousels. It’s time to identify the unique HTML attribute to tag these elements. The class name “entry-thumbnail” is the common class name for these elements. Select the element classes in the first column and select the condition. Enter the value as shown below. Save the trigger.
Try out the Piwik pro trial and let me know how do you feel about it.
Author: Ram Manohar
Independent Digital Analytics and Tag Management Consultant. Web Analytics Expert with 8+ years of experience. Well versed in Digital Analytics, Web Programming, WordPress and Digital marketing. Contact me for consulting!