Unknow location with geoip

Hello, my configuration:

geoip
geoip support enabled
geoip extension version 1.0.7
geoip library version 1004008

dev-php/pecl-geoip-1.0.7-r1

gentoo amd64

Piwik repport for region and city:
There is no data for this report because there is no location data available. To enable accurate geolocation, change the settings here.

Thanks to fix it.

Is this for old data? Enabling GeoIP means location data will be recorded for new visits only (the visits that are tracked AFTER you enable GeoIP).

If you want to see location data for old visits see this faq item: How to - Analytics Platform - Matomo . Then force your reports to be reprocessed (see this faq item: How to - Analytics Platform - Matomo ).

Old (Process by the script) and new data, same result: unknow location.

  1. In the geolocation admin screen is your location reported correctly?

  2. Which GeoIP database are you using? Make sure you’re using a city database if you want city + region data.

  3. In the visitors log if you put some of the IPs there into MaxMind’s demo here: GeoIP2 Database Demo | MaxMind , does it show the region & city?

  1. in front of geoip pecl: According to this provider, your current location is: Bolivia, Plurinational State of -> correct
  2. I don’t know, I have just install the pecl geoip, the database is included I think
  3. Yes, the ip is correctly resolved

Ok, I think you’re using a country database instead of a city database. If a city database was used, there would be more information about your location.

If you want Piwik to manage your GeoIP databases (in a later version there will be an auto-updater), download the GeoLite City database (link below), put it in the ./misc subdirectory of Piwik (named GeoIPCity.dat, not GeoLiteCity.dat) and follow the instructions at the end of this FAQ: How to - Analytics Platform - Matomo .

If you want to keep the databases where the PECL extension keeps them, then download the GeoLite City database, put it in the directory where the PECL extension looks for them & make sure to rename the database to ‘GeoIPCity.dat’.

You can figure out where the directory is by running: <?php echo dirname(geoip_db_filename(GEOIP_COUNTRY_EDITION));

Link to GeoLite City database: http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz

Same with launch misc/others/geoipUpdateRows.php or new visits.

At launch of misc/others/geoipUpdateRows.php I have:
PHP Notice: Undefined index: lang in /home/first-world.info/stat/plugins/UserCountry/LocationProvider/Default.php on line 34

Replace the script w/ this before you run it again: http://dev.piwik.org/trac/browser/trunk/misc/others/geoipUpdateRows.php?format=txt
It has better error reporting.

What did you do before you ran the script again?

Did you download the GeoLiteCity database and put it in the directory the PECL extension is using?

Or did you put it in Piwik’s misc directory?

Did you rename it to GeoIPCity.dat?

If you put it into the misc directory, did you add ‘geoip.custom_directory=/path/to/piwik/misc’ to your php.ini file like it says here (How to - Analytics Platform - Matomo )?

Does your location in the admin tab provide city + region info next to the PECL extension option or just the country?

With fixed (without GeoIPCity.dat):
geoip.custom_directory=/etc/php/geoip/
It work.

It’s not possible to fill this php setting into php and ship it into piwik (to prevent compilcated installation)?

[quote=dragonx86]
With fixed (without GeoIPCity.dat):
geoip.custom_directory=/etc/php/geoip/
It work.[/quote]

Glad to hear it’s working!

[quote=dragonx86]
It’s not possible to fill this php setting into php and ship it into piwik (to prevent compilcated installation)?[/quote]

If you mean using ini_set to set it then no, since some shared hosts will disable it, and besides i’m sure some will not want to store the databases w/ Piwik (if that’s what you meant).

Btw, can you tell me what’s in your /etc/php/geoip/ directory? In our tests the PECL module would only work w/ the city database if it was named GeoIPCity.dat. It would be good to know if this is not always true.

I have GeoIPCity.dat into it.

But into location & provider, 98% of the visitor is into unknow contry, region, city.

Good news: GeoIP is now integrated in Piwik, enabling Accurate Visitors Geolocation in your Analytics reports. To enable GeoIP go to the Settings > Geolocation admin page, and follow the short instructions.

You can also get an even more accurate Country & City Database from here to enjoy top accuracy in detecting your visitors locations.

See also the documentation about Geolocation - Analytics Reports in Piwik.

Good news: GeoIP is now integrated in Piwik, enabling Accurate Visitors Geolocation in your Analytics reports. To enable GeoIP go to the Settings > Geolocation admin page, and follow the short instructions.

You can also get an even more accurate Country & City Database from here to enjoy top accuracy in detecting your visitors locations.

See also the documentation about Geolocation - Analytics Reports in Piwik.

We need YOUR help! We are running a crowd funding campaign to raise funds to implement the detailed Visitors Maps of Countries, Regions and Cities (for all countries)!

These maps will be beautiful, usable, and built using open standards SVG+JS. They will show detailed visitor count, conversion rates, by Country but also (New!) by city and region.

Pledge now at: http://crowdfunding.piwik.org/analytics-maps-world-country-city-region/

There will be no more flash in Piwik and we will add amazing new Maps of your visitors.

Piwik needs you!

I prefer fund for more performance (more important). The tracking should should have generation page egal of php only. (or minimize the bandwidth)