Announcement: You can find the guides for Commerce 7.5 and later on the new Elastic Path Documentation site. The Developer Center continues to support Commerce 6.13.0 through 7.4.1.Visit new site

Data policy segments

Data policy segments

Data policy segments indicate logical segments of customers for which a data policy can be applied. For example, you can create data segments for different geographical locations, as required. Each data policy is associated with the one or more data policy segments. A data segment can be associated with one or more data policies depending on the data protection laws in that segment. How a data policy functions is configured by the front-end developer in the CMS.

Data policy segments are stored as a Set<String> segments in the DataPolicy object.

You can add a new data policy segment by adding a new string to Set<String> segments:

policy.getSegments().add(<NEW_SEGMENT>)

After adding new data policy segment to the collection, update data policy using the dataPolicyService.update(); method.