@triffic-tang opened this Issue on July 14th 2016

Piwik is a great app, wo do like it.
According to the API Response: Metric Definitions
nb_actions - Number of actions (page views, outlinks and downloads)

And I execute query like below on table piwik_log_visit

select sum(visit_total_actions) from piwik_log_visit where idsite=5 and date_add(visit_last_action_time, interval 8 hour)>="2016-07-01 00:00:00" and date_add(visit_last_action_time, interval 8 hour)<"2016-07-02 00:00:00"
But the query result 1236 greater than 1219 which showed on the dashboard.

Because visit_total_actions contains pageviews, downloads and outlinks, so how can I get the exact pageviews when execute sql query.

@mattab commented on July 14th 2016 Member

Hi @triffic-tang

have you seen our Mysql guide: http://developer.piwik.org/guides/persistence-and-the-mysql-backend

For example this page lists all the action types which is maybe what you need: http://developer.piwik.org/guides/persistence-and-the-mysql-backend#action-types

please note we recommend to use the Reporting APIs instead of direct SQL access: http://developer.piwik.org/api-reference/reporting-api

If you have further Piwik DB SQL queries feel free to ask in our forums: http://forum.piwik.org/

This Issue was closed on July 14th 2016
Powered by GitHub Issue Mirror