Wrong Country Listing


#1

Hi,

My piwik intallation is showing the wrong countries of visitors. I’m located in India, but my visits are always identified as from the US. I’m a newbie to Piwik. Should I be installing any additional plugins to the default installation to make it work accurately?

Can anybody here help me out?

Thanks in advance,
shine


#2

You need to configure Piwik to use a different method of identifying the location of the visitors to your site. Click on the Settings link at the top of the page after having logged into Piwik with your Admin credentials. Then click on the Geolocation menu option in the list down the left of the page.

The default Geolocation option is to use the language setting of the browser. If the browser is set to English (US), Piwik assumes the visitor is located in the USA. If it’s set to English (UK), Piwik assumes United Kingdom. If it’s German (Swiss), Piwik assumes Switzerland.

To activate one of the other options, you first need to install one of the GeoIP databases from MaxMind. I have set my site to use the GeoIP (PHP) method because that was the simplest to install, and because my site doesn’t see much traffic. Click on the How do I get the GeoIP databases? link above the GeoIP (PHP) option for information on how to download and install the proper database.

MaxMind updates its freely downloadable database on the first Tuesday of the month. Every month, on the first Wednesday, I download the GeoIP (City) database from the MaxMind site. After unpacking the database, the resultant file is renamed to “GeoIPCity.dat” and is then copied to the “misc” directory in the server’s Piwik installation to replace what’s already there.


#3

Hi canajun2eh,

Thanks a lot for your support. The plugin worked.

On another note, it would be nice if there was a list of plugins that were recommended to optimize the resullts of Piwik. I know each Piwik installation depends upon its web server, traffic load and other factors but plugins such as GeoIP are must-haves for any Piwik installation for the smooth running of the analytics. It would great if some expert of Piwik could possible take some time to list out such must-have plugins for Piwik and make a stick post, so that any newbie could effectively have their sites analyzed.

Thanks again for your support,
Appreciate it.

shine


(Parth Doshi) #4

Hi Shine,

How did it work for you? I am also from India and tried using the same plugin but it did not work for me. Can u please tell me what exact steps u did?


(Parth Doshi) #5

Hi Shine,

Did you purchase maxmind database or you used free one?


(Lukas Winkler) #6

Hi @Parth_Doshi

Are you using the latest Matomo version (3.5.0)?

Because it has now support for GeoIP2.

What is not working for you?


(Alamak) #7

@shine Have you try to install other free geolocation database such as IP2Location LITE? It does not have the general region code such as “EU” found in Maxmind. You can get the exact country code for each IP address using IP2Location LITE.

https://plugins.matomo.org/Ip2location


(Parth Doshi) #8

Hi Lukas,

I am using the Matomo version 3.5.0. I have also installed support for GeoIP2. It’s showing as Installed.

However, when I added the free Maxmind database in the “misc” folder of my piwik server instance,
it does not display the country properly in the Visitor map.

Also, although I have installed GeoIP2, it shows that Visitor IP address is unknown, city is unknown and country is unknown.

PS: I am from India.

Regards,
Parth!


(Parth Doshi) #9

Hi, I have used this plugin but I still do not see the visitor map getting updated correctly. Can you tell me which database file (.bin) for IP2Location did u use?


(Parth Doshi) #10

Please see this screenshot as well


(Roddy A. Stegemann) #11

There may be a simpler way. Have you tried the misnamed UserCountry plug-in? It reports the city, region, country, continent, as well as geographic coordinates of your visitors with good precision.

Roddy


(Lukas Winkler) #12

Hi,

The “issue” is that you are accessing Matomo via localhost. Therefore the IP-Address of the visitor (you) is localhost/127.0.0.1 which obviously can’t be geolocated.
Just try accessing Matomo from it’s publically reachable IP/Domain or from another network and it should be working fine.


(Parth Doshi) #13

Hi Lukas,

Thanks for providing the solution. Yes the “localhost” was indeed the issue and it has now be resolved by moving to a publicly accessible domain.

Also, I would suggest you to put this in the docs or somewhere as a disclaimer as this would help other developers as well.

Thanks once again.

Regards,
Parth