matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.87k stars 2.65k forks source link

Provide API to get browser/OS maps used in Piwik #1058

Open anonymous-matomo-user opened 14 years ago

anonymous-matomo-user commented 14 years ago

Currently in the database logs, browsers, operating systems, or countries are defined as static array :

static protected $browsers = array( 'opera' => 'OP', 'msie' => 'IE', 'microsoft internet explorer' => 'IE', 'internet explorer' => 'IE', ...

So I's currently impossible to format data with the label values accessing only database. (I must maintain a mapping list manually).

Proposal: provide API to publish this data. What data should it return appart from the Browsers and OS maps? Where should this API be?

robocoder commented 14 years ago

For performance, no, we have no plans to read from such tables, but I don't see why we couldn't maintain such tables or at least, make it export-ready via API.

mattab commented 14 years ago

Export ready via API sounds like a plan, not having these mapping in the DB (redundant data that we want to keep in files)

mattab commented 14 years ago

Of course, ideally the API would be used for everything, now that the Live! plugin (#44) has an extensive API to return the data from the piwiklog* tables.

anonymous-matomo-user commented 14 years ago

Ok thanks for your reply.

robocoder commented 13 years ago

For the purpose of discussion, I'm going to refer to this static data as System Tables.

We could add an API method for each system table in the closest/corresponding plugin, e.g., PluginName.getSystemTableName($parameters_if_any) for:

Example: SitesManager.getCurrenciesSystemTable()

We could also have API.getSystemTableMetaData().

mattab commented 13 years ago

System Tables are not required for any use of the API, since the API gives friendly name in output.

System tables are only used for low level SQL requests. I think API.getSystemTableMetaData() is less code & better to have all in 1 place, since one typically needs all system tables or none. Maybe named getSystemTables() ?