Segment API¶
Segments enable you to profile the content displayed to specific users.
To manage Segments, use the SegmentationService
.
Getting Segment information¶
To load a Segment Group, use SegmentationService::loadSegmentGroupByIdentifier()
.
Get all Segments assigned to the group with SegmentationService::loadSegmentsAssignedToGroup()
:
1 2 3 4 5 6 7 |
|
Similarly, you can load a Segment by using SegmentationService::loadSegmentByIdentifier()
:
1 |
|
Checking assignment¶
You can check whether a User is assigned to a Segment with SegmentationService::isUserAssignedToSegment()
:
1 2 3 4 5 |
|
Assigning Users¶
To assign a User to a Segment, use SegmentationService::assignUserToSegment()
:
1 |
|
Creating Segments¶
Each Segment must be assigned to a Segment Group.
To create a Segment Group, use SegmentationService::createSegmentGroup()
and provide it with a SegmentGroupCreateStruct
:
1 2 3 4 5 6 7 |
|
To add a Segment, use SegmentationService::createSegment()
and provide it with a SegmentCreateStruct
, which takes an existing group as one of the parameters:
1 2 3 4 5 6 7 |
|
Updating Segments¶
To update a Segment or a Segment Group, use SegmentationService::updateSegment()
or SegmentationService::updateSegmentGroup()
and provide it with SegmentUpdateStruct
or SegmentGroupUpdateStruct
, respectively.
Deleting Segments¶
To delete a Segment or a Segment Group, use SegmentationService::removeSegment()
or SegmentationService::removeSegmentGroup()
, respectively:
1 |
|