After Upgrading...Live Visitors--Broken?

After upgrading…

Live visitors doesn’t seem to update ‘live’ (I have to refresh) …and there is no longer a ‘stream’ of visitors and where they are from…the time they visited and what pages they visited :(…

Did something break?

I tried clearing out the database.

Please help!

I have the exact same problem. I suspect there is a date range issue in the live data retrieving code.

Getting the same problem, and it seems not only in live but no visitors at all are showing up.

All the parameters are showing but the list starts 5 hours earlier than present. If it is 2:00 pm the top hit is from ~9:00 am. My time offset from GMT happens to be 5 hours.

The problem does not exist in the detailed visitors log, the last 5 hours of visits are shown properly there.

There were timezone-related changes to the Live Visitors plugin. We will review and correct it in the next release.

In /piwik/plugins/Live/API.php you will find on about line 240:

$processedDate = Piwik_Date::factory($date, $currentTimezone);// if not commented, the Period below fails ->setTimezone($currentTimezone);

If you replace that with:

$processedDate = Piwik_Date::factory($date)->setTimezone($currentTimezone);

It should go back to working the way it did before. That’s what fixed it for me.

-Kevin

TucsonKevin -

“If you replace that with …”

Thank you.

[quote=azuswebworks]
TucsonKevin -

“If you replace that with …”

Thank you.[/quote]

So that worked for you?

…Was just gonna come back–and say live data is starting to appear for some reason now—but I also have the hours way OFF (and the time zone is correct).

I LOVE this stats program, so glad I decided to LOOK for something, and finally set something up—and then find this gem. Also, really cool how easy the update was…

Bummer tho–this is the first time I updated, and wasn’t very happy after I did… guess I’ll have to be a little more weary about it next timne :\

…Hey guys/developers, …anyway, to maybe add a ‘Rollback’ …in future…in case we run into problems—like something like this–and we wanna fix it immediately? (so we don’t need to be scared to update…hehe :D)

…Or prob unnecessary?

Either way, great program, and glad it’s being sorted.

[quote=azuswebworks]
TucsonKevin -

“If you replace that with …”

Thank you.[/quote]

This DOES fix the timezone issue… But I’m still having problems… there doesn’t seem to be a ‘live’ update anymore. Have to MANUALLY refresh the page to see the new changes.

Really sucked—thats the main thing I like about the stats program…is watching when new visitors come in.

What I’m doing…really requires it. I drive ‘live’ traffic manually from different places, and depending on how thigns are doing, I either INCREASE it…or CHANGE it… …need to see the ‘live’ updates :\

This is a bad hack, but it works for me…

In /piwik/plugins/Live/templates/index.tpl

on line 5 I replace initSpy(); with

/*initSpy();*/
window.setTimeout('updateVisitBox();',15000);

then inside the function updateVisitBox()

under the $("#visitsLive… line I add (about line 36 or so)

updateTotalVisits();
window.setTimeout('updateVisitBox();',15000);

It gets rid of the AJAXyness, but it helps my exported widgets to work inside Iframes on another domain, and still works within the piwik dashboard too

-Kevin

Jesus…what the hell did they do in this update that you had to figure that out :\

So man… you were having the same issues with me regarding that too? (It not updating)

Really appreciate the help BTW.

Super surprised the Update would be pushed so hardcore (it was in red letters wasn’t it? lol) …Then it be all messed like this. …Kinda disappointing… but I guess it’s free :\ Figure SOMEONE would have cut it or debugged tho…

That last hack was from a number of months ago. At the time, the Live visitors was working inside the Piwik dashboard, but it wouldn’t update live when it was exported to an IFrame on another domain. That hack fixed it, so I kept moving it to new versions. Hope it helps.

-Kevin
(not endorsed by Piwik, use at your own risk, as-is, no warranty, etc.)

[quote=TucsonKEG]
That last hack was from a number of months ago. At the time, the Live visitors was working inside the Piwik dashboard, but it wouldn’t update live when it was exported to an IFrame on another domain. That hack fixed it, so I kept moving it to new versions. Hope it helps.

-Kevin
(not endorsed by Piwik, use at your own risk, as-is, no warranty, etc.)[/quote]

Well I really appreciate it man. Thanks so much…

And I’m sure as do others that may come across this thread and need a fix…

Thanks again for sharing :slight_smile: Karma man–may it come back to you :slight_smile:

Thanks. The spy has been a performance issue for some sites, so it has been “tweaked” a bit. We’ll work on a better fix (including the frame issue).

[quote=TucsonKEG]
In /piwik/plugins/Live/API.php you will find on about line 240:

$processedDate = Piwik_Date::factory($date, $currentTimezone);// if not commented, the Period below fails ->setTimezone($currentTimezone);

If you replace that with:

$processedDate = Piwik_Date::factory($date)->setTimezone($currentTimezone);

It should go back to working the way it did before. That’s what fixed it for me.

-Kevin[/quote]

Thank you Kevin,

My 12 hour time offset was corrected with this fix. It drove me nuts, was short before downgrading to 1.1

Glad to help.

After applying the patch by Kevin above: 301 Moved Permanently

Can you please confirm that the

  • Live! plugin
  • and Visitor Log

are working as expected for the DAY, WEEK and MONTH period as well? Are the Live! and Visitor Log showing all visits from the selected period (including first hour of the day on monday, etc.).

We tried to fix a bug related to period in 1.2, just checking the patch does not change it back. Thanks

Matt,

yes, the patch from Kevin fixed it and all logs (day, week, month, year) are fine. In addition, the Live Widget is correct as well, last actual visit is shown as top entry.
The time off-set I had explained [piwik forum](24hours seperated in 2 days in my case) is fixed and it is working as in 1.1

If I applied the patch above, my visits don’t apper in the Live! widget, so while it may fix it for some, it does break something else. See ticket Live does not always show recent visitors based on timezone · Issue #2145 · matomo-org/matomo · GitHub