GeoIP 2 Location not working

Hello,

I have setup GeoIP in a Matomo instance, but the Country is not showing India or any other except US. Also Region & City are not recognized and shown as unknown always. Due to this issue, real time map is not getting loaded.

The Matomo server is running from a private LAN and with special access, it can be accessed from public internet for testing purposes.

I have done the following changes in an attempt to fix the issue:

  1. Turned off language based guess as specified in: https://matomo.org/faq/troubleshooting/faq_65/
  2. Made config changes for Matomo Apache server to allow the SVG file format to be sent for Location tracking.
  3. Setup Apache GeoIP 2 but ended up getting the error The MM_COUNTRY_CODE $_SERVER variable is not set. Your server may not be configured correctly., even though I had downloaded the free City and Country DBs from MaxMind and specified it in the configuration file.

Kindly provide your valuable comments to solve this issue.

Regards,
Sriram K.

So all IPs received by the server are considered as internal, isn’t it?
When an internal IP is received by Matomo, it uses the browser language to determine the country, en-US in your case… In your cae, you disabled this feature…

So all IPs received by the server are considered as internal, isn’t it?

Yes. But when I got the website to be accessed from public internet as well, it did not work.

Missed to mention: The IP address is received/displayed as masked for atleast one octet. Is this intended functionality?

Are you sure Matomo desn’t receive the proxy IP as the visiting IP?

See:

… Also, did you check the GeoIP is working well?

Maybe this plugin can also help you?

Just checked. And it is not fetching the intended IP.
What is my IP site shows the IP address as: 165.225.XXX.XXX
while Matomo shows the IP address in Visitor Log as: 192.168.XXX.XXX.
Why is there an inconsistency?

Also, Checked out the Privacy Settings configuration. They are in the same way as mentioned.
The GeoIP 2 for Apache is broken and the error displayed was given in the first post in this topic.

This plugin has some broken documentation it seems. Unable to update the DB table after installation.

Maybe this could solve your problem:

I am using the Matomo tracker in JavaScript code (using _paq.push(...)).

This seems to use API tracking, which is different from what I am using. Also, using Admin token, which exposes threat to security (can be identified from Network tab of Developer Console).

Is there a safe way for this?

Sorry, I don’t understand your problem…
Is it still related to GeoIP 2 Location not working topic?

Yes.
I was saying that when I use the tracker code via JavaScript (using _paq.push(...)) the tracking happens, but the location is not being identified accurately.

I was trying to send the “cip” to Matomo server. But which API (action name) should I exactly hit to get my cip recorded?