Expand my Community achievements bar.

SOLVED

How to replace Merge policy on Segments in bulk.

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

@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

View solution in original post

4 Replies

Avatar

Correct answer by
Employee Advisor

@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

Avatar

Level 2

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

Avatar

Employee Advisor

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

Avatar

Level 2

Thanks @Tof_Jossic , Sure will submit the post in the Ideas section. 

 

Regards,

vinod