Adobe Campaign: Script code for A/B



Hi there, 

I am trying to create an A/B with Adobe Campaign following the instructions here: . I've created three targeted populations (A,B,C) and I would like to set up automatically a delivery for the target C which would be the result of the winner version between A and B. Once I start sending my emails, it comes out that I am not able to send the winner version to the target C. I was wondering that maybe the script code attached is wrong??

// query the database to find the winner (best open rate)

var winner = xtk.queryDef.create( <queryDef schema="nms:delivery" operation="get"> <select> <node expr="@id"/> <node expr="@label"/> <node expr="[@operation-id]"/> </select> <where> <condition expr={"@FCP=0 and [@workflow-id]= " +}/> </where> <orderBy> <node expr="[indicators/@estimatedRecipientOpenRatio]" sortDesc="true"/> </orderBy> </queryDef>).ExecuteQuery() // create a new delivery object and initialize it by doing a copy of // the winner delivery var delivery = delivery.Duplicate("nms:delivery|" + winner.@id) // append 'final' to the delivery label delivery.label = winner.@label + " final" // link the delivery to the operation to make sure it will be displayed in // the campaign dashboard. This attribute needs to be set manually here since // the Duplicate() method has reset it to its default value => 0 delivery.operation_id = winner.@["operation-id"] // adjust some delivery parameters to make it compatible with the // "Prepare and start" option selected in the Delivery tab of this activity delivery.scheduling.validationMode = "manual" delivery.scheduling.delayed = 0 // save the delivery in database // store the new delivery Id in event variables vars.deliveryId =

Could anyone give it a look and help please?

Many thanks,


Accepted Solutions (1)

Accepted Solutions (1)




Hi Carlota,

Thank you for reaching out to Adobe Community.

This code needs a manual intervention and debugging. I would recommended working with the client care team so that this can be checked at their end.


Answers (0)