Piwik Ecommerce Extension for Magento
by Adrian Speyer • Last modified:December 13, 2012 • Piwik, Plugin • 17 Comments

One thing lacking from the Magento store was a Free Piwik Extension that gave you the real power of Piwik Ecommerce in your install. I am proud to announce, that today marks a change. I have released a plugin that automatically inserts the Piwik Tracking code into Magento 1.7. It automatically sets up Ecommerce tracking that you expect: product & category views, cart updates, orders, along with all standard Piwik tracking. You can get it here now! As of version 1.0.6, you also have access to your Piwik data from within Magento via an iFrame!
To help with the installation an any questions, below is how to set it up, but trust me it’s so easy, you can do this before you finish a beer. The first step is to make sure you have installed, Piwik on your host. Make sure you set it up with your Magento Website and enable Ecommerce Tracking in the settings:
![]()
Once your Piwik is working,visit Magento to get the Piwik Extension for Magento. Click install to get the connection key you will need to paste in your Magento Connection Manager.

All done. Now just go back to your Magento dashboard menu, click on System >; Configuration. You will find “Piwik Analytics Control” on the left hand side. If hit a 404 page, or any issues make sure you clear your Magento cache.

Make sure you enable the extension (but it does not take to you save config). Fill in the address to your Piwik install and the site id.

Your Piwik Auth Token, can be found in your Piwik Install under the API tab. Please note if more than one user will access the data, it is best practice to create a generic Piwik account, which can be shared by all users. Use this API key instead of the SuperUser Api Token.

Once you have everything in place, click save config, (you’ll find it in the top right corner) and go enjoy your beer. You are now tracking your visitors and customers with Piwik. You can access your Piwik data from within Magento from “Reports” tab:

Below is an example of the iframe in action:

Remember to include the whole Piwik in an iframe, edit your config/config.ini.php in your Piwik Install and add the following line:
[General]
enable_framed_pages=1
I have also created the below video to help you get through the install.
For those code geeks, source code is available on Google and Github. If you encounter an issue, leave a message below or use the contact us form. So what are you waiting for already? Go download it here. Happy tracking!
******FAQ*****
Does this work with earlier versions of Magento (i.e 1.6.x)?
No, it does not, out of the box. This extension uses Magento’s 1.7 compliance with EU cookie tracking rules. To make it work with earlier versions, I have created the following mod. I have tested on my local dev and seems to work ,but you should try for yourself. Just unarchive the file and make sure you clear your cache. Please note, this disables the EU tracking function added in Magento 1.7 for Piwik, so you will have to make sure you comply with local laws. Updated to Extension Version 1.1.1
I get a 404 page after I click Piwik Analytics Control?
Make sure to clear the cache. Sometimes you have to log out and then login. It’s a Magento Cache bug beyond my control.
Why I am not seeing any Ecommerce tracking? All my carts are abandoned!
This plugin has been tested with Express, Standard and Pro versions of Paypal. The solution in 99.9% of cases is that you need to ensure you have the right settings in Paypal/Magento. Make sure Data Transfer is on, make sure you use the right IPN url for Magento. Ect. The only other reason the plugin would not work is customer does not click “Return to Store” after finishing their purchase.
I get blank pages in my theme, what can I do?
If you experience a blank page, try changing <reference name="before_body_end"> to <reference name="head"> in the layout file.
Can I restrict access to Piwik Analytics Control?
Yes, by using the simple role permissions in Magento backend, you can restrict access to the iframe or Piwik analytics control.
I want you to rewrite or modify your plugin just for me ?
I always appreciate user input, but to rewrite or modify this plugin is not easy to do without breaking compatibility for all other users. You need to also keep in mind this extension is free. I do not make money from this module in any way. I did it for free to share with the community of Piwik users. If a request makes sense for the community (i.e to enable new Piwik functionality) I will work on it for free. However, in order to completely rewrite or modify a plugin for custom tastes takes time. I do not have an interest in doing this kind of work for free. If you are willing to pay for changes or modifications, you may use the contact form and provide more details on the project. I can then work up a quote and timeline for changes. If you do not wish to pay, you are free to modify the plugin as you see fit. It was released open source and the code is published on Github.
