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

Visitors in real time data gone after 4PM Piwik 3.0 #11165

Closed
djsaturn opened this issue Jan 10, 2017 · 16 comments · Fixed by #11425
Closed

Visitors in real time data gone after 4PM Piwik 3.0 #11165

djsaturn opened this issue Jan 10, 2017 · 16 comments · Fixed by #11425
Labels
Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Milestone

Comments

@djsaturn
Copy link

djsaturn commented Jan 10, 2017

After I upgraded to version 3.0 some of my reports are off. Visitors in real time disappears after 4PM. When I click on visitor log there is no data. Some reports show that it's the next day. My website is set to America/Los_Angeles. It looks like some reports may be going off UTC time and not the timezone that is
set.

Screen shot taken on 2017-01-05 @ 5PM.

piwik

@mattab mattab added this to the 3.0.2 milestone Jan 13, 2017
@mattab
Copy link
Member

mattab commented Jan 13, 2017

Many users experience this bug in Piwik 3. this is a regression (IIRC we changed something in the Live API which can explain this)

@mattab mattab added the Regression Indicates a feature used to work in a certain way but it no longer does even though it should. label Jan 13, 2017
@ZacharyDuBois
Copy link

ZacharyDuBois commented Jan 25, 2017

Can confirm. Having this issue on Piwik 3.0.1. When you have server and Piwik set to EST (America/New_York) the live visitor log and some graphs increment to the next day at 19:00EST/00:00UTC. So I assume it's just Piwik is forgetting to look at the correct date and time somewhere.

@ZacharyDuBois
Copy link

So an update, a lot of Piwik is affected by this bug. The actual analytics aren't affected, just the display of the data as nothing actually gets logged as being the next day but it just breaks some things when the date in EST doesn't equal the date in UTC. Looking at my data, you can see this is a new install.

The original issue:
screen shot 2017-01-24 at 21 10 57

The actual visitor logs aren't being displayed as soon as 19:00EST/00:00UTC hits.

But the following are also affected:
screen shot 2017-01-24 at 21 08 15
screen shot 2017-01-24 at 21 22 42

The incorrect/issues are highlighted in red and where the time is correct is in green. The current time EST is also displayed.

A work around for that last two images is to reapply the time using the time selector dropdown. This only fixes the graphs advancing a day and listing the visitors in the full-page visitor log (not the live widget).
screen shot 2017-01-24 at 21 38 56

@collinbarrett
Copy link

I am seeing this as well. Happy to provide further logs/info if it will help debug.

@mattab
Copy link
Member

mattab commented Feb 22, 2017

Hi guys,

Since it used to work I've looked at recent commits that could potentially have some impact related to this bug. The only one I could find was: 029d0ff

So -> could you please try to apply back this patch in your Piwik, and check if you still experience this timezone issue? It's a long shot, but it's worth a try. Thanks in advance for your feedback...

@mattab
Copy link
Member

mattab commented Feb 24, 2017

@djsaturn @ZacharyDuBois @collinbarrett Is the patch above working? Please let us know

@mattab mattab modified the milestones: 3.0.2, 3.0.3 Feb 24, 2017
@collinbarrett
Copy link

Hi @mattab , I have never built Piwik. I am assuming to "apply the patch", you mean get the source at that version, compile, and install? I'd love to help, but I'm not sure I'll have time to do that anytime soon. If it's easier than I am thinking it will be, though, please let me know and I will try to help. Thanks.

@mattab
Copy link
Member

mattab commented Feb 24, 2017

In the file plugins/Live/Model.php go to line: 508
just after this line which has $processedDate = Date::factory($date);

add the following code:

                if ($date == 'today'
                    || $date == 'now'
                    || $processedDate->toString() == Date::factory('now', $currentTimezone)->toString()
                ) {
                    $processedDate = $processedDate->subDay(1);
                }

@collinbarrett
Copy link

Oh, duh, it's php so it's not really compiled code. I live in C# world in my day job... Sure, I can test that tonight. I can't really test that it works until after roughly 5pm CST which is about when I notice that it stops working. I'll get back to you tonight or sometime this weekend with the results. Thanks.

@djsaturn
Copy link
Author

I think it should be line 485 according to the code (I'm on 3.0.1). I put in the fix and will report back after tonight.

@djsaturn
Copy link
Author

djsaturn commented Feb 25, 2017

It looks like this has fixed the issues.

@collinbarrett
Copy link

Agreed. It is working for me with this patch as well.

@mattab
Copy link
Member

mattab commented Feb 28, 2017

Thanks for the feedback @collinbarrett @djsaturn 👍

@ZacharyDuBois do you have a chance to test the patch as well?

@ZacharyDuBois
Copy link

@mattab Just applied it. I'll see tonight if it fixes :)

@ZacharyDuBois
Copy link

@mattab Can confirm that the issue is fixed.

@ZacharyDuBois
Copy link

@mattab UPDATE: That fixes the live widget but the rest of the stats still move on to the next day still (see my original screenshots).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants