Child pages
  • Geo Location Services
Skip to end of metadata
Go to start of metadata


The Geo Location Services is an app that once installed offers a web service that receives an IP value and returns a two-character ISO 3166-1 country code in which that IP resides. With this app you can enable Geo IP functionalities in your apps. For example you can choose which content to show to your users based on the country they are located.

This app uses Maxmind GeoLite2 Country CSV database. You download that database from here and then use an interface that is also provided by this app to import that data into Liferay. You won't need to use an external service anymore to provide Geo IP functionalities in your portal. 


The installation steps are as follows:

  • Obtain the Geo Location Services app from the Liferay Marketplace.
  • Deploy the app in your existing Liferay installation. If you haven’t installed Liferay, please download and follow the instructions to do so.
  • Download Maxmind GeoLite2 CSV databases from here: Be sure to download the GeoLite2 version and not the GeoIP2 version. The direct link is this:
  • Access Control Panel -> Configuration -> Geo Location Services and upload the corresponding files

  • A notification in the dockbar will be sent after the process it's completed, in the meantime you can continue using Liferay.


To view the JSON web services for the Geo Location Services app, access the following link [portal]:[port]/geo-location-services-portlet/api/jsonws e.g http://localhost:8080/geo-location-services-portlet/api/jsonws


To use this service in your portlets or templates use this code:

<script type="text/javascript">
    IP: ''
  function(obj) {


or if you prefer to use JQuery use this one:

<script type="text/javascript">

    $.get( "/api/jsonws/geo-location-services-portlet.geolocations/get-location/IP/", function(data, status) {




If the IP value is not valid or if can't be found in the database it will return an empty String ("") value.

Code repository

The latest source code is located at the following location:

Contact Us

We welcome feature/bug reports concerning the Geo Location Services app. Discussion helps to clarify the ways the app can be used and also helps define directions for future development. Please post your concerns at


Change log:


New feature: Help page.


Company credits.


  • No labels