Segmentation By Geolocation
Liferay DXP 7.4 U44+/GA44+
You can configure Segments by geolocation to display different pages dynamically or content based on the user’s country. To display different pages, you can use Experiences, and to display specific content on the page, you can use Collections.
Creating a Segment by Geolocation
First, create a User Segment following the steps in Creating User Segments.
-
Once created, drag and drop the IP Geocoder Country session property onto the canvas.
-
Select one of the four conditions from the comparison drop-down: equals, not equals, contains, not contains.
-
Select a Country from the Country drop-down.
-
Click Save.
You can combine multiple properties with conditions. See Configuring Segment Conditions to learn more about combining conditions. Once created, you can use this Segment to create personalized experiences for users. See Content Page Personalization and Personalizing Collections for more information.
Configuring the Geolocation Database
A geolocation database contains a mapping between IP addresses and their countries of origin. To configure this,
-
Open the Global Menu () and go to Control Panel → System Settings.
-
Click on Third Party from the Platform section.
-
Click IP Geocoder Configuration from the left menu to set the path to a custom geolocation database.
The file path is empty by default. When empty, it uses the free GeoLite2 database to resolve IP addresses. Optionally, you can set the path to a different geolocation database with the .mmdb
extension on your server to override the default database.