I have a situation where I send tracking requests from the server on behalf of user. To make sure I track the user's correct IP address rather than my own server's address, I add the
cip parameter to the request as referred to here. I've noticed that since doing this, the user's IP addresses are not geo-coded to have a country any more and just display as 'Unknown' with a question mark.
I believe that if the
cip parameter is included, this should be what gets fed into the GeoIP database. I have other sites tracking to the same Matomo installation via JS directly so am sure the country detection is working.
I'm using Matomo version 3.12.0 from the official Docker image (matomo:3.12.0-apache).
Hi there, I recommend you check if
From what I can see in the code this should work and we're actually using this in many places ourselves and don't have any issues with it.
Hi @tsteur, thanks for your reply. Can't find "Use anonymized IP for visit enrichment" exactly but "Anonymize Visitors' IP addresses" is unchecked - is this the same? Couldn't seem to see anything similar in
For the token permissions, under "API Authentication Token" I can only view or regenerate. Visits are definitely being logged though so I assume this means it has write permissions.
I've updated to version 3.13 in case these settings changed names but doesn't look like it.
Visits are definitely being logged though so I assume this means it has write permissions.
This does not mean the token was write permission. You'll need to double check if the token auth is correct, and whether the user for that token has write permission (eg a super user can check this but you can also check if that user has permission to create for example Goals).
@damianmoore Which GeoIP location provider have you configured in Matomo?
@tsteur I can confirm the token_auth is correct and it belongs to the role for this user under "Manage Users" shows as "Super User".
This screenshot is of the site where Matomo requests are proxied with
token added by the backend.
This screenshot is of a different site where requests go directly to Matomo and countries are detected from header IP.
Any other ideas for things I can check?
@damianmoore I would recommend to maybe enable tracker logging for a short time to investigate the issue further:
See https://developer.matomo.org/api-reference/tracking-api#debugging-the-tracker on how to enable tracker debug. (should be only enabled for a short time since this may be visible to your users if someone was to actually look at the response of tracking requests)
And you maybe want to enable logging to file see https://matomo.org/faq/troubleshooting/faq_115/ so you can see what happens for the requests that use
Any update maybe @damianmoore - do you still experience the issue?
I've just figured out what was happening when I reported this issue and now have it all working without changing my API calls to Matomo. I had wrongly thought I had Geocoding set up because I saw countries displayed for other sites I had on my Matomo installation. I hadn't realised that Matomo infers country from browser language and I was not including this header when calling the API myself. Now I have DBIP configured correctly I have countries and much more accurate city level data.