[Piwik-hackers] API: querying data for last X

Anton Andrievskij x.meglio at gmail.com
Wed Jun 4 09:42:03 CEST 2008


Hi, Matt.

You wrote:
>> It would be incorrect as today's stats are never up to date.

Actually when you query visits by weeks, months or years you will always get
uncompleted data.

Example. If you query for last 3 weeks today, the latest week will be
2008-06-02 to 2008-06-08. What you are doing in Piwik is you do not include
today's visits, but in this case the latest week still remains incomplete
because there are also future days which are not included in the sum.

So when I query for last week - I actually want to know the real value
including today's visits - then it makes sense. I think you definitely have
to add this option in configuration:
include_today_statistics_in_period_archives. Or else querying for last week,
month or year have no sense?

The real example where it is interpreted as error is when I want to show to
users the visits of their pages for last week. They tell me: I asked my
friend to open this page and then I'm going to see statistics, but there is
still 0 visits. Why? Every people think that it is error and statistics does
not work. So I think the idea is to have Piwik working as user expected. It
will be correct from user's point of view, not from developer's point of
view. What do you think about it?

Actually I'm forced to configure Piwik to rebuild archives every time - and
then I get correct statistics and testers are happy then. But then I'm
worried about speed. Does this configuration really slows Piwik with
thousands of users/pages?

Thanks for discussion,
Anton Andriyevskyy

On Wed, Jun 4, 2008 at 4:03 AM, Matthieu Aubry <matthieu.aubry at gmail.com>
wrote:

>  (In the future please post a new message for each distinct question)
>
> This is the behaviour for piwik archives: period statistics (week / month /
> year statistics) do *not* include today's statistics.
> It would be incorrect as today's stats are never up to date. This is also
> for performance reasons (we have to compute these reports only once a day).
>
> There could be an option "include_today_statistics_in_period_archives" but
> I'm not sure about the value here.
>
> Anton Andrievskij wrote:
>
> When I query for last 2 weeks (or last 2 days) - I get today's visits:
>
> http://mysite.com/piwik/?module=API&method=VisitsSummary.get&idSite=2&period=
> *week*&date=last2&format=xml
>
> But if I get for last 2 months (or last 2 years) - I do not get today's
> visits:
>
> http://mysite.com/piwik/?module=API&method=VisitsSummary.get&idSite=2&period=
> *month*&date=last2&format=xml
>
>
> _______________________________________________
> Piwik-hackers mailing list
> Piwik-hackers at piwik.org
> http://lists.piwik.org/cgi-bin/mailman/listinfo/piwik-hackers
>
>


-- 
Best regards,
Anton Andriyevskyy

Please think about the environment
and do not print this e-mail
unless you really need to.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.piwik.org/pipermail/piwik-hackers/attachments/20080604/2d8794cc/attachment.htm 


More information about the Piwik-hackers mailing list