K Khan
Oct 30, 2016
  4456
(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
Integrating Optimizely DAM with Your Website

This article is the second in a series about integrating Optimizely DAM with websites. It discusses how to install the necessary package and code t...

Andrew Markham | Sep 28, 2024 | Syndicated blog

Opticon 2024 - highlights

I went to Opticon in Stockholm and here are my brief highlights based on the demos, presentations and roadmaps  Optimizely CMS SaaS will start to...

Daniel Ovaska | Sep 27, 2024

Required fields support in Optimizely Graph

It's been possible to have "required" properties (value must be entered) in the CMS for a long time. The required metadata haven't been reflected i...

Jonas Bergqvist | Sep 25, 2024

How to write a bespoke notification management system

Websites can be the perfect vehicle for notifying customers of important information quickly, whether it’s the latest offer, an operational message...

Nicole Drath | Sep 25, 2024

Optimizely DAM – An Introduction

I presented a talk about the Optimizely DAM at the OMVP summit during Opticon 2024 in Sweden. I have now converted that talk into two blog posts....

Andrew Markham | Sep 25, 2024 | Syndicated blog

Simple and Effective Personalization with Optimizely Data Platform (ODP)

As we dive into the amazing capabilities of Optimizely One, let’s shine a spotlight on the Optimizely Data Platform (ODP). This simple tool unifies...

Alex Harris - Perficient | Sep 24, 2024 | Syndicated blog