Ab test workflow to test 4 subject lines in one workflow | Community
Skip to main content
Level 4
March 10, 2024
Solved

Ab test workflow to test 4 subject lines in one workflow

  • March 10, 2024
  • 1 reply
  • 491 views

@Parvesh_Parmar ,@AkshayAnand 

,@isahore ,@AndreaBriceno,@ParthaSarathy

,@ParthaS ,@Craig_Thonis ,@Manoj_Kumar_ ,@Amine_Abedour ,@Marcel_Szimonisz,@DavidKangni 

,@Amit_Kumar,@ShashankNigam02,@Ganesh5067, @Jonathon_wodnicki

@Amine_Abedour 

 

hi all

i need to create ab test workflow to test 4subject lines in one workflow

 

also when i am runnjng out of box script given in

aodbe doc

its failing ..any one have ab test Js script code 

which support 4segment in a wkf

also please share insights what and how can we modify the oob script to make this work for 4segments

 

 

 

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 isahore

Hi @dishasharma,

 

Can you share details as to what error you are seeing and what code have you written?

The standard js code that evaluates the winner delivery based on the configured criteria should work fine for handling any number of variants.

 

// query the database to find the winner (here - best click rate) var winner = xtk.queryDef.create( <queryDef schema="nms:delivery" operation="get"> <select> <node expr="@id"/> <node expr="@label"/> <node expr="[@operation-id]"/> <node expr="[@workflow-id]"/> </select> <where> <condition expr={"@FCP=0 and [@workflow-id]= " + instance.id}/> </where> <orderBy> <node expr="[indicators/@totalRecipientClickRatio]" sortDesc="true"/> </orderBy> </queryDef>).ExecuteQuery() // create a new delivery object and initialize it by doing a copy of // the winner delivery var delivery = nms.delivery.create() 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. delivery.operation_id = winner.@["operation-id"] delivery.workflow_id = winner.@["workflow-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 delivery.save() // store the new delivery Id in event variables vars.deliveryId = delivery.id

BR,

Ishan

 

BR,

Ishan

1 reply

isahore
Community Advisor
isahoreCommunity AdvisorAccepted solution
Community Advisor
March 11, 2024

Hi @dishasharma,

 

Can you share details as to what error you are seeing and what code have you written?

The standard js code that evaluates the winner delivery based on the configured criteria should work fine for handling any number of variants.

 

// query the database to find the winner (here - best click rate) var winner = xtk.queryDef.create( <queryDef schema="nms:delivery" operation="get"> <select> <node expr="@id"/> <node expr="@label"/> <node expr="[@operation-id]"/> <node expr="[@workflow-id]"/> </select> <where> <condition expr={"@FCP=0 and [@workflow-id]= " + instance.id}/> </where> <orderBy> <node expr="[indicators/@totalRecipientClickRatio]" sortDesc="true"/> </orderBy> </queryDef>).ExecuteQuery() // create a new delivery object and initialize it by doing a copy of // the winner delivery var delivery = nms.delivery.create() 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. delivery.operation_id = winner.@["operation-id"] delivery.workflow_id = winner.@["workflow-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 delivery.save() // store the new delivery Id in event variables vars.deliveryId = delivery.id

BR,

Ishan

 

BR,

Ishan