-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Date Range is not correct recognized in Metadata API #3074
Comments
I guess the bug is somewhere here https://github.com/piwik/piwik/blob/master/core/Period/Range.php#L262 To reproduce just open the url (replace domain + idsite) and switch the date to March 24 before: e.g. sudo date -s "24 MAR 2012 10:22:00" |
I cannot reproduce that. maybe it is already fixed? |
It is still reproduceable... As mentioned you have to change the date and you should make sure the date is not changed by the system while testing (for example by ntpd) |
Increasing priority of this bug, which was reported in the forum too |
Note for @matt: this bug is caused by something in the Piwik_Period_Range::processOptimalSubperiods function. I think you said you were going to clean this code up (I couldn't figure out what the optimizations were)? Anyway, #2270 requires a change to the same method, so I think they can both be done at the same time. |
Maybe also similar / related to #3782 |
…g dates under circumstances
When using period=range and the "To" date is set to today, the API sometimes returns a wrong date. Example:
At March 24 I tried to call this url:
http://demo.piwik.org/index.php?idSite=7&date=2012-03-22,2012-03-24&filter_sort_column=nb_visits&apiModule=VisitsSummary&apiAction=get&period=range&filter_limit=30&module=API&token_auth=anonymous&format=json&method=API.getProcessedReport&language=de
I got the following response
{"website":"Piwik Forums","prettyDate":"19 M\u00e4r 12 - 24 M\u00e4r 12","metadata":{"category":"Besucher\u00fcberblick","name":"Besucher\u00fcberblick","module":"VisitsSummary","action":"get","metrics":{"nb_uniq_visitors":"Eindeutige Besucher","nb_visits":"Besuche","nb_actions":"Aktionen","nb_actions_per_visit":"Aktionen pro Besuch","bounce_rate":"Absprungsrate","avg_time_on_site":"Durchschnittliche Besuchszeit (in Sekunden)","max_actions":"Maximale Aktionen pro Besuch"},"metricsDocumentation":{"nb_visits":"Wenn ein Besucher zum ersten Mal die Webseite besucht oder seit dem letzen Seitenaufruf mehr als 30 Minuten vergangen sind, wird dies als neuer Besuch gewertet.","nb_uniq_visitors":"Die Anzahl der eindeutigen Besucher auf der Webseite. Jeder Benutzer wird nur einmal gez\u00e4hlt, auch wenn er die Webseite mehrmals t\u00e4glich besucht hat.","nb_actions":"Die Anzahl der Aktionen, die ein Besucher durchgef\u00fchrt hat. Aktionen sind Seitenansichten, Downloads und der Aufruf von externen Links.","nb_actions_per_visit":"Die durchschnittliche Anzahl der Aktionen (Seitenaufrufe, Downloads oder Outlinks), die w\u00e4hrend der Besuche durchgef\u00fchrt wurden.","avg_time_on_site":"Durchschnittsl\u00e4nge eines Besuches.","bounce_rate":"Der Anteil der Besuche, bei denen nur eine Seite aufgerufen wurde. Dies bedeutet, dass der Besucher die Website auf der Eingangsseite sofort wieder verlassen hat.","conversion_rate":"Prozentsatz der Besucher, die ein Zeil erreicht haben.","avg_time_on_page":"Die durchschnittliche Besuchdauer einer Seite (nur die einzelne Seite, nicht die gesamte Webseite)","nb_hits":"Die Anzahl, wie h\u00e4ufig diese Seite besucht wurde.","exit_rate":"Der Anteil der Besuche, welche die Webseite nach dieser Seite verlassen haben."},"imageGraphUrl":"index.php?module=API&method=ImageGraph.get&idSite=7&apiModule=VisitsSummary&apiAction=get&token_auth=anonymous&period=day&date=2012-03-22,2012-03-24","uniqueId":"VisitsSummary_get"},"columns":{"nb_uniq_visitors":"Eindeutige Besucher","nb_visits":"Besuche","nb_actions":"Aktionen","nb_actions_per_visit":"Aktionen pro Besuch","bounce_rate":"Absprungsrate","avg_time_on_site":"Durchschnittliche Besuchszeit (in Sekunden)","max_actions":"Maximale Aktionen pro Besuch"},"reportData":{"nb_visits":"5505","nb_actions":"14058","max_actions":"112","bounce_rate":"64%","nb_actions_per_visit":2.6,"avg_time_on_site":"00:02:56","nb_uniq_visitors":0},"reportMetadata":[],"timerMillis":"42"}
Note the Date "19 M\u00e4r 12 - 24 M\u00e4r 12". I've requested 22-24 but it returns 19-24.
Today, I tried to call this url:
http://demo.piwik.org/index.php?idSite=7&date=2012-03-27,2012-03-28&filter_sort_column=nb_visits&apiModule=VisitsSummary&apiAction=get&period=range&filter_limit=30&module=API&token_auth=anonymous&format=json&method=API.getProcessedReport&language=de
and it returns the date for "26 M\u00e4r 12 - 28 M\u00e4r 12"
Is this a bug or am I doing something wrong? I implemented the date range picker into Piwik Mobile. If it's a bug, it would be great to see a fix in the next release.
The text was updated successfully, but these errors were encountered: