How to replace Merge policy on Segments in bulk. | Community
Skip to main content
New Participant
February 24, 2023
Solved

How to replace Merge policy on Segments in bulk.

  • February 24, 2023
  • 1 reply
  • 1294 views

We have around 150+ Segments and some of them are using non default merge policy. According to the Journey Optimizer processing. All those segments which are using non-default merger policy won't be able to use in the journeys. We need to identify these segments which are using non-default merge policy and change it to Default time based merge policy. 

My question

1.  How to identify all the segment where the specific merge policy is used

2. How to replace the merge policy in bulk. Can we use API for this?

 

Regards,

Vinod

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Tof_Jossic

@vinkom Please see Segment definitions endpoint

 

If you play around with the following calls as a test, you should be able to edit the segment merge policy as well:

GET https://platform.adobe.io/data/core/ups/segment/definitions/:SegmentID 

PATCH https://platform.adobe.io/data/core/ups/segment/definitions/:SegmentID     

 

Based on the documentation, I used something like:

 

{ "id": "segmentID", "name": "value", "profileInstanceId": "ups", "description": "value", "expression": { "type": "PQL", "format": "pql/text", "value": "value" }, "schema": { "name": "_xdm.context.profile" }, "mergePolicyId": "value", "payloadSchema": "string", "ttlInDays": 30 }

 

This is part of the Segmentation Service API, available HERE

 

Also note, once updated via the API, you will no longer be able to edit the segments via the UI

1 reply

Tof_Jossic
Tof_JossicAccepted solution
Employee
February 24, 2023

@vinkom Please see Segment definitions endpoint

 

If you play around with the following calls as a test, you should be able to edit the segment merge policy as well:

GET https://platform.adobe.io/data/core/ups/segment/definitions/:SegmentID 

PATCH https://platform.adobe.io/data/core/ups/segment/definitions/:SegmentID     

 

Based on the documentation, I used something like:

 

{ "id": "segmentID", "name": "value", "profileInstanceId": "ups", "description": "value", "expression": { "type": "PQL", "format": "pql/text", "value": "value" }, "schema": { "name": "_xdm.context.profile" }, "mergePolicyId": "value", "payloadSchema": "string", "ttlInDays": 30 }

 

This is part of the Segmentation Service API, available HERE

 

Also note, once updated via the API, you will no longer be able to edit the segments via the UI

vinkomAuthor
New Participant
February 26, 2023

Thanks @tof_jossic , I tried the patch method and the payload for patch needs entire definition of the segment. It would be time taking and copy paste process to extract the definition of the segment and make the changes to the payload and resubmit as the patch. Instead, the patch solution should have been like Field Group "Patch" API call. Just what property we need to replace and the corresponding value. 

{

    "op": "replace",

    "path": "/mergePolicyId",

        "value": "<revised Merge Policy ID>"

   

}

 

If I don't find a solution, I can manually change the segment id in the browser for segment edit page and just select the relevant merge policy and save the segment. This might take just a minute to do for each segment. I feel this is faster process.

 

Regards,

Vinod

Tof_Jossic
Employee
February 27, 2023

Hi @vinkom, this is a good point you're making. You may want to post something in the 'ideas' section of this forum for an improvement on making a simplified API call, specifically for changing the merge policy.

Note the product teams are monitoring those ideas so they might take this into consideration for future enhancements to make