legacy-knowledge-base
Publicado Jun. 25, 2030

How to implement segmentation by geolocation?

written-by

Jose Bodega

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

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+

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)
  • Note that the geolocation service must be from a third party.
did-this-article-resolve-your-issue

legacy-knowledge-base