Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I get the exact pageviews when execute sql query? #10299

Closed
triffic-tang opened this issue Jul 14, 2016 · 1 comment
Closed

How can I get the exact pageviews when execute sql query? #10299

triffic-tang opened this issue Jul 14, 2016 · 1 comment
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@triffic-tang
Copy link

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
Copy link
Member

mattab commented Jul 14, 2016

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/

@mattab mattab closed this as completed Jul 14, 2016
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Jul 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

2 participants