• Piwik Ecommerce Extension for Magento

    by  • Last modified:December 13, 2012 • Piwik, Plugin • 17 Comments

    magento+piwik Piwik Ecommerce Extension for Magento

    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:

    Ecommerce Tracking Piwik Ecommerce Extension for Magento

    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.

    magento connection manager1 Piwik Ecommerce Extension for Magento

    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.

    magento piwik config menu Piwik Ecommerce Extension for Magento

    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.

    config 1024x270 Piwik Ecommerce Extension for Magento

    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.

    piwik api key 1024x353 Piwik Ecommerce Extension for Magento

    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:

    iframe piwik Piwik Ecommerce Extension for Magento

    Below is an example of the iframe in action:

    iframe piwik backend 1024x511 Piwik Ecommerce Extension for Magento

    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.

    About

    About The Author: Adrian has over 10 years experience in Web Marketing and Analytics. He currently works for one of the world's largest electronic component distributors as a Web Analytics Manager, handling their analytics needs worldwide. Adrian is also certified in Google Analytics and you can find him working with the team at Piwik.org in his spare time.

    • Hiro Protagonist

      Adrian, first of all thank you for your effort on this and for making this extension available to the OSS community. I have installed the latest version of the extension on Magento 1.7.0.2 and everything seemedd to go ok but I don’t get any data back, neither on the “native” piwik page, nor on the embedded one in Magento Admin. Where can I look first ?

    • harryk

      Hi,
      Fisrt thanks for this extension.
      I’ve only one problem.

      I can’t see visitor detailes log.
      When I click on the link, i’ve only the message “Data Loading” but nothing happened and I stay on the first page.
      Have you got an idea??

      Thanks in advance

    • http://www.facebook.com/Fortin.Mathieu Mathieu Fortin

      Does this work with earlier versions of Magento (i.e 1.6.x)?

      Your patch is incomplete. You must also comment out the endif; matching the if statement you’re commenting out. It works great otherwise! Thanks!

      • http://www.adrianspeyer.com/ Adrian

        @facebook-544540886:disqus that for catching. I missed it on the last update.

    • alex

      I installed it and got the following error message Class ‘Mage_PiwikAnalytics_Helper_Data’ not found in /home/username/public_html/app/Mage.php on line 546
      please advise

      I am using magento version 1.7.02

    • http://twitter.com/kylefaino Kyle Faino

      Any plans to further develop this extension for compatibility with Magento Enterprise 1.12?

      • http://www.adrianspeyer.com/ Adrian

        I know there are users who have deployed in Enterprise without issue. You can try for yourself in a test/dev environment. To make an enterprise version would require an enterprise license — to cover the cost of this I would have to charge for the plugin. It’s also something that does not make sense to me in terms of time as the current plugin seems to work in enterprise.

    • Caleb

      Plugin seems to be working just fine, however our system logs are filling up with this:

      Notice: Undefined offset: 0 in /var/www//app/code/community/Mage/PiwikAnalytics/Block/Piwik.php on line 148

      Seems to be one entry per page load, which makes magento’s system log grow very large, very quickly. Any Ideas? Latest Piwik, magento CE, and your mod.

      • http://www.adrianspeyer.com/ Adrian

        Are you using Piwik Magento Plugin 1.11?

        • Caleb

          Yep. Magento 1.7.0.2, Piwik 1.11.1, Piwik Magento Plugin1.1.1 (per Magento Connect Manager).

          • http://www.adrianspeyer.com/ Adrian

            Hmmm. It must be related to your category names. Not seeing an issue on this side. What site is it on? I’ll take a look.

    • 1Agency

      Great extention but we have a huge problem since some weeks and i dont know if the bug lies in this extention or in piwik itself.
      everytime someone is placeing something in the cart, it will be shown in piwik as abadoned cart.

      • http://www.adrianspeyer.com/ Adrian

        All carts are abandoned until they are completed purchases. One issue could be users not clicking the “back to site” in Paypal. This is how Magento will tell Piwik the order is complete. To reduce this issue I recommend you keep users on your site for payment.