Piwik – Web analytics – Open source
Piwik is a downloadable, open source (GPL licensed) real time web analytics software program. It provides you with detailed reports on your website visitors: the search engines and keywords they used, the language they speak, your popular pages…
Piwik is GPL, that means that building on top of it as a library must be GPL also but consuming the data from the API as a service doesn’t ( http://piwik.org/faq/new-to-piwik/#faq_56 )