Add the GeoIP2/GeoLite2 Database to a Project

This feature relies on the GeoLite2 or GeoIP2 database provided by MaxMind.



Enable IP geolocation in Relevance by adding the MaxMind GeoIP2 or GeoLite2 database to a project.


To determine the geographical location attributes such as longitude, latitude, and city name, an IP geolocation database can be added to a project that will be used to convert the visitor’s IP address to geographical information.

Download MaxMin GeoIP2 or GeoLite2 Database

MaxMind provides a database that can be used with Bloomreach Experience Manager's Relevance Module to get geographical location information about visitors. Bloomreach Experience Manager supports both the free of charge GeoLite2 database and the more detailed GeoIP2 City database.

Download either the GeoLite2-City or GeoIP2-City database binary from MaxMind.

Add the Database to a Project

The instructions below assume you are using GeoLite2 but are identical for GeoIP2 except for the database filename (GeoIP2-City.mmdb instead of GeoLite2-City.mmdb).

There are two methods to add the database:

Choose the method that best fits your project configuration and development and deployment processes.

Method 1: As a Maven Dependency

This method creates a small Maven project that wraps the database and is added as a dependency to the Bloomreach Experience Manager implementation project.

Create a Maven project with the following structure:

|-- src
|   `-- main
|       `-- resources
|           `-- GeoLite2-City.mmdb
`-- pom.xml

Place the GeoLite2-City.mmdb file in src/main/resources.

Create a root pom.xml with contents similar to the example below.

  • Set the groupId and artifactId following the conventions of your organization.
  • For the artifact version, consider using the GeoLite2 release datestamp.
  • Add your organization's Maven repository to the distributionManagement section.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""


      <name>My Company Maven 2 Repository</name>
Build the 'brxm-maxmind-geolite2' project and deploy the artifact using mvn install (local) or mvn deploy (remote).

In your Bloomreach Experience Manager implementation project, in cms-dependencies/pom.xml, add the 'brxm-maxmind-geolite2' artifact as a dependency:


Method 2: As a Spring Bean Override

This method overrides the Spring bean for the GeoIPService and injects the location of the GeoLite2-City.mmdb database file.

Place the GeoLite2-City.mmdb file in a sensible place in your file system (example assumes /path/to/GeoLite2-City.mmdb).

In your implementation project, create a Spring configuration file at cms/src/main/resources/META-INF/hst-assembly/overrides/targeting-addon-geolite2.xml with the following contents:

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns=""
       xmlns:xsi="" xmlns:util=""

  <bean id="com.onehippo.cms7.targeting.geo.GeoIPService" class="com.onehippo.cms7.targeting.geo.GeoIPServiceImpl">
    <property name="databaseFile" value="/path/to/GeoLite2-City.mmdb" />


Don't forget to replace the databaseFile value with the actual path to the GeoLite2/GeoIP2 database in your environment.

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?