Issue
- I want to apply a user segment based on a geolocation condition. Is it possible?
Environment
- Liferay DXP 7.2
- Liferay DXP 7.3
- Liferay DXP 7.4
Resolution
DXP 7.4 u44+
- Since Liferay DXP 7.4 u44+, this functionality is available out-of-the-box: Segmentation By Geolocation.
DXP 7.2, 7.3
NOTE: The following resolution requires customization and should only be implemented at the discretion of your team. Liferay Support will not be able to assist with designing or implementing customizations.
- It is not possible to apply a user segment based on a geolocation condition before DXP 7.4 with the default Liferay functionality.
- However, you can achieve your goal by developing a product customization based on the following article -> https://help.liferay.com/hc/en-us/articles/360029067391-Creating-a-Request-Context-Contributor. Basic steps:
- Create a class to develop a new custom field in the segmentation section (
SegmentsFieldCustomizer.java) -
Create a class to provide geolocation functionality to the previous field. (
SampleRequestContextContributor.java)
- Create a class to develop a new custom field in the segmentation section (
- Note that the geolocation service must be from a third party.