Fatal Error: GeoIP

I’m following the documentation included here: http://dev.piwik.org/trac/ticket/45

I’m trying to apply the plugin to all previous visits. However, when I follow the first step and use the browser to run geoipUpdateRows.php I get the error below.

Fatal error: Call to undefined method Piwik_Common::long2ip() in /home/riispiwi/public_html/plugins/GeoIP/GeoIP.php on line 289

Does anybody have any suggestions on how to correct this?

Piwik_Common::long2ip() exists in 1.4 and 1.5… What Piwik version are you running?

Check that you have the latest version of GeoIP – I thought I changed it to use Piwik_IP::P2N().

I could’ve sworn I had just upgraded Piwik, but I didn’t. I’ve upgraded now to 1.5. During the install I had to upgrade my database and it disabled the GeoIP plugin for some reason. I reactivated it.

GeoIP is version 0.17.

Now whenever I browse to that URL, I get the following errors.

Fatal error: Cannot redeclare geoip_country_code_by_name() in /home/riispiwi/public_html/plugins/GeoIP/libs/geoip.inc on line 347

Fatal error: Undefined class constant 'PRIMARY_TYPE_NUM' in /home/riispiwi/public_html/libs/Zend/Session/SaveHandler/DbTable.php on line 522

For whatever reason it’s logging everything correctly.

Only problem now is that it’s showing the exact cities my traffic is coming from and I don’t know what state they’re coming from. Is there any way to display City, ST in that format or just which state the traffic is coming from?

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.