Contact not picking up Country information on localhost with Geolite 2 enabled

Damian Druzynski asked on July 14, 2023 15:06

Hi there

I have followed a number of suggested articles on the Xperience 13 Documentation site but I'm still not able to get the Country information pulling through for a newly created Customer entry. New entries are being created whenever I clear cookies or run in an Incognito window but I never see the country field populated. Running locally I have even changed the permission settings to allow full access to the mmdb file. I have the logging script setup in my layout file, the database is in both the CMS and MVC website folder (probably not necessary) and I've added the UseActivityTracking call in the service setup in startup. Enable contact geolocation by IP is enabled and I've enabled "track countries" under the Web Analytics settings. No errors in the event logs. Any other way I can debug this?

Thanks

Correct Answer

Juraj Ondrus answered on July 17, 2023 14:59

I have created the /App_Data/CMSModules/WebAnalytics/MaxMind/ folder just in the front end app - .NET core, and copied the free DBs as instructed in the documentation.
Then, I have added the CMSUserHostAddress key into the appsettings.json and used some IP address I found on the Internet. Build the .NET Core app to make the settings effect.
Then I enabled the geolocation feature in Settings, default mappings.
And then, I used incognito window in Chrome, loaded the Dancing Goat live site, filled out the form. Then, in a minute or two the information was synced to admin app and I can see the right information. Here is the result.
And now I tried using NL IP address, again incognito window....result

0 votesVote for this answer Unmark Correct answer

Recent Answers


Juraj Ondrus answered on July 17, 2023 08:32

How are you passing thew IP information to detect the country when running on localhost? Have you tried faking the IP using the approach mentioned in this article?

0 votesVote for this answer Mark as a Correct answer

Damian Druzynski answered on July 17, 2023 08:54

Thanks Juraj, yes I am using that exact approach to fake the address, have tested with several different IP's

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on July 17, 2023 13:14 (last edited on July 17, 2023 13:14)

Could you please describe all your setup and what DBs are you using? I just tested it and it works perfectly fine. Also, make sure you are using incognito window or clear the entire browser cache and cookies.

0 votesVote for this answer Mark as a Correct answer

Damian Druzynski answered on July 17, 2023 14:11

Hey Juraj

Okay so I am running the project locally, the CMS and Website are in their own projects within the same solution. The CMS database is on a company server which I access via VPN. I have the Geolite2-City.mmdb file in BOTH the CMS and Website projects at /App_Data/CMSModules/WebAnalytics/MaxMind/ thought I imagine the CMS instance is unnecessary. The Kentico CMS version is v13.0.81 The net6.0 MVC Web project is running a React user interface.

0 votesVote for this answer Mark as a Correct answer

Damian Druzynski answered on July 17, 2023 14:29

Further info... The project is not running within the Inetpub folder so I have even added IIS_IUSRS and IUSR with full modify rights to the folder in case that was an issue The Activity tracking IS working as I have multiple entries in the Contacts lists and can generate my groupings etc just cannot get the City or Country information to capture. I've left the field mappings for the Geolocation at default as well

0 votesVote for this answer Mark as a Correct answer

Damian Druzynski answered on July 17, 2023 15:10

Thank you Juraj! The CMSUserHostAddress key in the appsettings.json sorted the issue. I had that key set in the main CMS folder

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.