as I installed earlier the GeoIP plugin that makes use of MaxMind’s lite/free database, I noticed that the Realtime Visitors widget still displayed the flag associated to the less accurate, default country detection.
So if you also are using the GeoIP plugin and MaxMind’s database for greater accuracy, and want the Realtime Visitors widget to reflect this information, all you have to do is edit the file /plugins/Live/Visitor.php, and make some replacements, which are shown below.
// return Piwik_CountryTranslate($this->details['location_country']);
// return Piwik_getFlagFromCode($this->details['location_country']);
// return Piwik_ContinentTranslate($this->details['location_continent']);
I have a weird issue with GeoIP.
When GeoIP proccesses IP numbers, it ALWAYS sets country to United Kingdom(gb), city to Unknown(NULL) and continent to europe(eur). The host is located in UK, I thought this might be why lol.
However when I run geoipUpdateRows.php, they are fixed.
To further understand the issue, I have checked the log_visit table in the piwik db. After converting location_ip to real IP numbers and checking them thru geoiptool.com, the IP numbers show the real location, just like running geoipUpdateRows.php.
So my issue is GeoIP plugin doesn’t process IP numbers correctly itself, I have to run geoipUpdateRows.php.
I have tried to compare how does geoipUpdateRows and GeoIP procces IP numbers, so far I couldn’t find a difference.
I’ve started some code, but am at an early stage since I am working on several things at the moment, so I am afraid it’s going to take a little time.
It’s not just a patch, but something a bit bigger, but I’ll give more details once I’ve got some draft that I can actually show at a public demo location, otherwise the surprise is ruined
There is an error. Please report the message and full backtrace in the Piwik forums.
Warning: Cannot modify header information - headers already sent by (output started at /home/kaden106/datatracker/plugins/GeoIP/GeoIP.php:1) in /home/kaden106/datatracker/core/Controller.php on line 415
Backtrace --> #0 Piwik_ErrorHandler(2, Cannot modify header information - headers already sent by (output started at /home/kaden106/datatracker/plugins/GeoIP/GeoIP.php:1), /home/kaden106/datatracker/core/Controller.php, 415, Array ([moduleToRedirect] => CoreHome,[actionToRedirect] => index,[websiteId] => 1,[defaultPeriod] => day,[defaultDate] => yesterday)) called at [(null):0]#1 header(Location: index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday) called at [/home/kaden106/datatracker/core/Controller.php:415]#2 Piwik_Controller->redirectToIndex(CoreHome, index) called at [/home/kaden106/datatracker/plugins/CoreHome/Controller.php:41]#3 Piwik_CoreHome_Controller->redirectToCoreHomeIndex() called at [(null):0]#4 call_user_func_array(Array ( => Piwik_CoreHome_Controller Object ( => CoreHome, => , => , => 0, => Piwik_Site Object ( => 0)), => redirectToCoreHomeIndex), Array ()) called at [/home/kaden106/datatracker/core/FrontController.php:125]#5 Piwik_FrontController->dispatch() called at [/home/kaden106/datatracker/index.php:60]
I have begun working on a rewrite for this plugin that will include City, State,PostalCode,AreaCode,DMACode.
I have it saving this information to the piwik_visit table already but want to get the archiving working correctly and then create the reports to display this information. When I have that done I will submit it for review.
Hey Vito Botta, thanks for your response.
Unfortunatly I have already tried this Just to be sure, changed the value to something else and back, but no difference happened. The problem seems to lay somewhere else.
I’m glad that it’s working for you now.
The formatting “city, state zip” works for the US, but does not mean that much for other countries.
I’m anxious to see a new GeoIP release integrating that additional piece of information. And then if possible, the location could be added to the map.
Anyhow, I am migrating all the site references from Google Analytics to Piwik. After doing some research, I found out that Google Analytics does not share any data with the search engine. So I don’t see any reason for using outside marketing tools any longer.