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

in realtime map, display warning if there are no visits because of missing latitude/longitude #6704

Closed
alphaonex86 opened this issue Nov 20, 2014 · 28 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.

Comments

@mattab
Copy link
Member

mattab commented Dec 1, 2014

Hi @alphaonex86 which version do you use? does it work for you on the http://demo.piwik.org ?

@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Dec 1, 2014
@mattab mattab added this to the Short term milestone Dec 1, 2014
@alphaonex86
Copy link
Author

Hello,
I have the last version, (I update each time since piwik < 0.8).
http://demo.piwik.org/ always work.
Some time like today the real time map work. Other day will don't work (all website).
Then better error repporting when php can't send data, to push it to javascript, and from js display it from the browser. That's will be a good start to debug it.

@alphaonex86
Copy link
Author

I presume it's based ont this query, at the end the exact reply to replay and reproduct the bug:
Request URL:https://X.X.X.X/index.php?period=range&idSite=9&segment=&date=last30&format=json&showRawMetrics=1&module=API&method=Live.getLastVisitsDetails&filter_limit=100&showColumns=latitude%2Clongitude%2Cactions%2ClastActionTimestamp%2CvisitLocalTime%2Ccity%2Ccountry%2CreferrerType%2CreferrerName%2CreferrerTypeName%2CbrowserIcon%2CoperatingSystemIcon%2CcountryFlag%2CidVisit%2CactionDetails%2CcontinentCode%2Cactions%2Csearches%2CgoalConversions%2CvisitorId%2CuserId&minTimestamp=-1
period:range
idSite:9
segment:
date:last30
format:json
showRawMetrics:1
module:API
method:Live.getLastVisitsDetails
filter_limit:100
showColumns:latitude,longitude,actions,lastActionTimestamp,visitLocalTime,city,country,referrerType,referrerName,referrerTypeName,browserIcon,operatingSystemIcon,countryFlag,idVisit,actionDetails,continentCode,actions,searches,goalConversions,visitorId,userId

The reply show more than 80+ entry:
http://files.first-world.info/temp/piwikbug.txt

@mattab
Copy link
Member

mattab commented Apr 7, 2015

Hi @alphaonex86 do you still have the issue in the latest Piwik release? (if so would you mind posting a screenshot)

@alphaonex86
Copy link
Author

Yes the issue remain active :(
http://files.first-world.info/temp/piwik.png

@mattab
Copy link
Member

mattab commented Apr 8, 2015

i'm wondering if it's same bug as in: #6703

Does it maybe work when you load Piwik over HTTP?

@alphaonex86
Copy link
Author

Don't work in https and http.

@mattab
Copy link
Member

mattab commented Apr 8, 2015

@alphaonex86 would it be possible to get access to your PIwik server? if you can email me matt att piwik.org your piwik URL + login + password + link to this issue, it would really help. Thanks

@alphaonex86
Copy link
Author

Send by email

@mattab
Copy link
Member

mattab commented Apr 10, 2015

@alphaonex86 thanks for sending the access. Reproduced that the real time map doesn't work. it's strange because the data received by the API looks correct and works. So there is a problem in the JS somewhere. there is no error logged... the normal non-real time map works well too.

If anyone has also this issue of Real time map does not work while the other maps in Location menu works, please leave a comment

@mattab mattab modified the milestones: Mid term, Short term Apr 10, 2015
@alphaonex86
Copy link
Author

It's the seconds hurge and problematic bug in my case. Hardened and stabilise the code is very usefull for large scale usage. And don't keep years/months the bug open without any work on it.

@alphaonex86
Copy link
Author

Same with 2.13

@alphaonex86
Copy link
Author

Any way to have priority for this bug?

@diosmosis
Copy link
Member

@alphaonex86 I took a look at your Piwik using the credentials you sent to matt. The problem is that the realtime map requires visits to have latitude/longitude data, but none of them do. I looked at your geolocation settings, and it looks like you only have the country database. Can you use the city database?

@alphaonex86
Copy link
Author

Then the first step is do a warning on realtime map. I will try that's.
Work only with country will be great too.
Thanks for to take a look.

@alphaonex86
Copy link
Author

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.
index.php?module=Proxy&action=getCoreJs&cb=503856cd524ab9742be8e70c310a3d17:2522 Uncaught TypeError: Cannot read property 'remove' of undefined

@mattab
Copy link
Member

mattab commented May 25, 2015

Then the first step is do a warning on realtime map.

👍 When we detect that the user is not using the city database, we could display a warning notification above the real time map eg. For the real time map to work, you need to use the GeoIP City database. Please go to <a>Geolocation settings</a> and setup the GeoIP city database. or better

@mattab mattab modified the milestones: Short term, Mid term May 25, 2015
@alphaonex86
Copy link
Author

Yes, and like you do when only have country but not city, resolv from country database.

@alphaonex86
Copy link
Author

if(removeOldVisits){visitSymbols.remove(function(r){if(r.lastActionTimestamp<oldest)_removed++;return r.lastActionTimestamp<oldest;});}
Uncaught TypeError: Cannot read property 'remove' of undefined
Bug from now, I think it's due to few days data tracking with geoip.
index.php?module=CoreHome&action=index&date=yesterday&period=day&idSite=1#/module=UserCountryMap&action=realtimeWorldMap&date=yesterday&period=day&idSite=1

@diosmosis
Copy link
Member

@alphaonex86 I checked your realtime map (using the credentials you provided to @mattab) and it looks fine (viewed on Chrome). I can email you a screenshot if you'd like.

@alphaonex86
Copy link
Author

@diosmosis it's the problem, sometime work, other time don't work.
When it don't work I see into chrome console the previous error. If you need more info, tel me what I need look. I will look when don't work again.

@diosmosis
Copy link
Member

To try and diagnose the issue, you'll have to find the result of a specific XHR request when the map isn't working. To do this when you see the error, do the following:

  1. Open the inspector tools & reload the page.
  2. Switch to the 'Network' tab.
  3. Look for the XHR request that looks like index.php?module=API&method=Live.getLastVisitsDetails and get the response.

If there's no error in the response, then look at your webserver logs & the Piwik log file (if you've got logging enabled). Hopefully there will be an error somewhere.

@alphaonex86
Copy link
Author

[28-May-2015 01:26:31 UTC] PHP Fatal error: Call to undefined method Piwik\DataTable\Map::getMetadata() in /home/first-world.info/stat/plugins/Bandwidth/Bandwidth.php on line 117
[28-May-2015 01:26:31 UTC] PHP Fatal error: Uncaught exception 'Exception' with message 'Call to undefined method Piwik\DataTable\Map::getMetadata()' in /home/first-world.info/stat/plugins/CorePluginsAdmin/Controller.php:371
#1 /home/first-world.info/stat/core/FrontController.php(531): call_user_func_array(Array, Array)
#2 /home/first-world.info/stat/core/FrontController.php(97): Piwik\FrontController->doDispatch('CorePluginsAdmi...', 'safemode', Array)
#3 /home/first-world.info/stat/core/FrontController.php(184): Piwik\FrontController->dispatch('CorePluginsAdmi...', 'safemode', Array)
thrown in /home/first-world.info/stat/plugins/CorePluginsAdmin/Controller.php on line 371

On the log I see only that's.

@diosmosis
Copy link
Member

That error is unrelated. Please follow the steps in my comment when the realtime map is not working.

@alphaonex86
Copy link
Author

Ok. Can you at least put and if fonction undefined where mentionned skip the code part to prevent error?

@diosmosis
Copy link
Member

You can add this yourself if you don't want to investigate the random issue, but we won't hide a possible bug in an actual release.

@mattab mattab changed the title Real time map don't work When real time map doesn't display users, display help message notification with solution Jun 8, 2015
@mattab
Copy link
Member

mattab commented Jun 8, 2015

@alphaonex86 I took a look at your Piwik using the credentials you sent to matt. The problem is that the realtime map requires visits to have latitude/longitude data, but none of them do.

issue was renamed and scope reduced to: When real time map doesn't display users, display help message notification with solution.

The notification would be displayed when the wrong Geo ip database is used, and would suggest user to setup the right geoip database instead (with a link to Administration > Geo location settings).

@RomanStone
Copy link

RomanStone commented Jul 12, 2018

My case Switched to
Settings -> Geolocation -> GeoIP 2 (Php) : On
to make Real-time Map work.

Reason
piwik/plugins/UserCountryMap/javascripts/realtime-map.js:407

if (report.length) {
    // filter results without location
    report = $.grep(report, function (r) {
        return r.latitude !== null;
    });
}

And Ajax Response with "Default" Location Provider

{
...
    "city": null,
    "latitude": null, <--
    "longitude": null,
    "visitLocalTime": "00:00:01"
}

@mattab mattab changed the title When real time map doesn't display users, display help message notification with solution in realtime map, display warning if there are no visits because of missing latitude/longitude Aug 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

4 participants