First of all I would like to Thanks PIWIK team for creating such a beautiful analytics software. We are using it for last two year without any problems.
We have an application with hundered of pages being tracked by PIWIK with separate site in PIWIK for every page.
We show the stats (views, visitors and conversions etc) along with the pages listing in our application.
Currently, we fetch a stats for pages from their creation date and update in database to show them to user, which takes a lot resources and time.
Now, I am considering to track when I last updated the stats and then fetch the differential stats only next time and add them up to last fetched stats.
Is there any machenism available in PIWIK to keep the stats synced in our application, or any other better approach to accomplish this?
matt, Yes, I am using Piwik APIs (VisitsSummary.getVisits etc).
If I setup the cron properly, is it okay to fetch the stats for every page from the date of it’s creation everytime? Currently, when I fetch stats for multiple sites, in the date range I consider the creation date of oldest page (from the list of current sites) to determine the last{N} days.
An important point to note is that I need the total stats for every site from its creation date. These stats are not for charts etc, but to show the totals for every site.
Another thing, to fetch the stats I need to make three API calls (views, unique visitors, and conversions) to Piwik. Is there any possiblity that I send only one request and get all the stats in the response? We have PHP guys if this requires additional coding. Is there any related plugin or pointers we can get started with it.