0

I am looking for an open source web analytic for my Rails 4.2 app, so after some research I found that piwik fit my needs. can I use "piwik" with postgresql ? it seems that they only support mysql but I am not sure if it still true at this moment!

also I've found a post about how to integrate it within Rails here but they use piwik_analytics which is a Gem for Ruby on Rails 3.x and may not work with 4.2 !

All the information I've found are a little outdated and I am not sure if there is a way to make it work with my current requirements. any help please ?

medBouzid
  • 7,484
  • 10
  • 56
  • 86

1 Answers1

1
  1. Piwik supports only MySQL, that's true
  2. You don't need any gem because Piwik just needs to load some Javascript that needs to be embedded into your layout/views. The Rails app doesn't directly interact with it, only your visitors' browser. Which also means that it shouldn't matter whether it supports Postgres because it will most likely run on another machine as your Rails app.

Edit:

  1. Regarding the gem you mentioned: I looked at it, too, when adding Piwik analytics to my app, but in the end went with writing the few required lines of JS myself.
Marcus Ilgner
  • 6,935
  • 2
  • 30
  • 44
  • what do you mean exactly by " it will most likely run on another machine as your Rails app." ? I would like to keep using postgres for my app, do you mean that I should install piwik as a separate app on another server – medBouzid Apr 26 '15 at 20:03
  • Yes, Piwik needs to be installed separately anyway as it requires PHP, so it's a good idea to run it on a different server than your Rails app. – Marcus Ilgner Apr 26 '15 at 20:04
  • it's clear now thank you :) is there a gem to get data from piwik ? I need to grab some data from piwik and show them inside my rails app – medBouzid Apr 26 '15 at 20:33
  • Ok, that's a whole different thing then. The best approach imho would be to set up a database connection to Piwik's MySQL instance (in addition to your regular database) and run the required queries. I don't think there are any ready-made gems for this. – Marcus Ilgner Apr 26 '15 at 20:37
  • Ah, yes. If that one's still current and the API provides all the data you need, then that one looks quite promising indeed. – Marcus Ilgner Apr 26 '15 at 20:49
  • not sure if it provide all the data I will need but I will try it :) thank you for the help. I appreciate it ^^ – medBouzid Apr 26 '15 at 20:51