Try our conversational search powered by Generative AI!

K Khan
Oct 30, 2016
  4298
(8 votes)

maxmind geolite2 on nuget

GeoIP2 is MaxMind's newest IP intelligence offering and is available in different flavours. EPiServer's geo location visitor group is depending on MaxMind's legacy database that they are not updating any more, following nuget package 'PixieEPiServerExtensionMaxMindGeoIP2' can be an option. It is based on MaxMind.Db and MaxMind.GeoIP2 apis. Code is available on GIT. It has been implemented as a service that potentially can be replace with your own geo location service also. Same service can be used out side of visitor group also

e.g

GeolocationMaxmindService service = new GeolocationMaxmindService();
            NameValueCollection config = new NameValueCollection();
            config.Add("databaseFileName", @"C:\EPiServer\Extension\Maxmind\GIT\Maxmind.GeoIP\GeoIpTests\db\GeoLite2-City.mmdb");
            var result = service.GetGeoLocation(IPAddress.Parse("213.205.251.152"), config);
            

Following settings will require to use it in vistor group criteria.

<geolocation defaultProvider="maxmind">
      <providers>
        <add name="maxmind" type="Pixie.Extensions.Maxmind.GeoIp.Provider.MaxmindGeoIp2, Pixie.Extensions.Maxmind.GeoIp" databaseFileName="App_Data\GeoLite2-City.mmdb" />
        <!--<add name="maxmind" type="EPiServer.Personalization.Providers.MaxMind.GeolocationProvider, EPiServer.ApplicationModules" databaseFileName="App_Data\GeoLiteCity.dat" />-->
      </providers>
    </geolocation>
Oct 30, 2016

Comments

Aria Zanganeh
Aria Zanganeh Oct 30, 2016 11:55 PM

Great job .. I was thinking about similar concept to use Google API! 

K Khan
K Khan Nov 3, 2016 09:42 AM

@Aria, Thanks, Glad, you like it.

Feb 1, 2017 10:30 AM

Good work.

Does the nuget Package contain a job to automatically update the Geo lite2 database?

K Khan
K Khan Feb 1, 2017 09:58 PM

@janaka, thanks for the feed back, it's not available at the time, but I will consider this. Personally I prefer controlled upload of these kind of files on prod.

Please login to comment.
Latest blogs
Solving the mystery of high memory usage

Sometimes, my work is easy, the problem could be resolved with one look (when I’m lucky enough to look at where it needs to be looked, just like th...

Quan Mai | Apr 22, 2024 | Syndicated blog

Search & Navigation reporting improvements

From version 16.1.0 there are some updates on the statistics pages: Add pagination to search phrase list Allows choosing a custom date range to get...

Phong | Apr 22, 2024

Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog

Azure AI Language – Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog

Fix your Search & Navigation (Find) indexing job, please

Once upon a time, a colleague asked me to look into a customer database with weird spikes in database log usage. (You might start to wonder why I a...

Quan Mai | Apr 17, 2024 | Syndicated blog