Retrieving stats in a custom plugin returns wrong numbers
-
Hello,
We are trying to pull the stats from Jetpack using ‘stats_get_csv’ but it seems to be returning incorrect results when we compare it to the monthly stats in the Jetpack Dashboard.
For example we use this code to get stats for December 2014 for a specific post:
$args = array(
‘end’ => ‘2014-12-31’,
‘days’ => 31,
‘limit’ => -1,
‘post_id’ => 240668,
);
$postStats = stats_get_csv( ‘postviews’, $args );But the returned number is significantly different from what is shown in the Stats Dashboard for that particular post and that month.
I’ve been trying different args as per the API documentation but simply cannot figure out what I am doing wrong. Using the “month” for period also produced incorrect results. Please advise.
Best,
Jakub
The topic ‘Retrieving stats in a custom plugin returns wrong numbers’ is closed to new replies.