Expand my Community achievements bar.

We are excited to introduce our latest innovation to enhance the Adobe Campaign user experience — the Adobe Campaign v8 Web User Interface!
SOLVED

Pass through Delivery ID

Avatar

Level 3

Hi,

I am doing an AB Test and need to pass through the Delivery ID in order to then union the data back together and perform some analysis on the results (producing data extracts of recipient activities). However I can't seem to get a delivery ID to be passed through from the deliveries themselves. I've tried adding it as a variable but this doesn't appear to work.

What is passed through is the 'Foreign Key of the link 'Message' (field 'id') field. Whilst this serves almost the same function there are two issues with this field.

  1. It doesn't exist until the Delivery is run and therefore causes issues in any workflow which relies on linking to this field.
  2. It doesn't appear to be generated for the AB test 'Winner' delivery.

Any advice would be much appreciated. Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi Alistair,

I have a solution which is more of a hack, not elegant but should serve your purpose.

  1. I've implemented this in a single transition but you can duplicate the setup for multiple deliveries.
  2. Create a transition with JS activity (to define instance variable and initialize it), query activity to pick target audience, Enrichment to add our variable to the transition, delivery (with content).
  3. We will dynamically set the internal name of delivery in our workflow. In other words, the internal name generated by campaign will be dynamically overridden to the one we initialize in JS activity, 
  4. Please refer to this image to see the whole setup and how it works. 
  5. Inside JS code activity initialize the instance variable which will contain the internal name we wish for delivery in the transition.
    instance.vars.dynamicInternalName = "delivery1"

     

  6. Inside Enrichment define variable to be added to output transition.

  7. Right click on the delivery activity and click on Open option to view the Initialization Script section. Use the following code to dynamically change the delivery internal name 

    delivery.internalName = instance.vars.dynamicInternalName

     

  8. Execute the workflow, delivery will be created with internal name of our choice. Also, the output transition will contain this internal name becuase of the hack done inside Enrichment.

Hope this helps.

Regards,

Vipul

View solution in original post

10 Replies

Avatar

Employee Advisor

Hi Alistair,

I'm not sure if it's only me, but I'm not able to understand the complete requirement here.

Can you please elaborate more on the requirement, as to which of the three deliveries' id you wish to pass forward?

Regards,

Vipul

Avatar

Level 3

Hi Vipul,

Thanks for the response.

There are two steps here and hopefully solving the first will solve the second as well.

  1. I want the delivery internal name for each delivery to be available in the target data after the delivery but don't seem to be able to find out how best to do this. I can get the delivery internal name to be included as a personalised variable in the email itself but also want to have it present in the target data after the delivery. Please see this thread and assume that instead of the 'var.greeting' variable I would instead have the delivery internal name of the delivery.

    I've also tried to follow the documention, the example here is manually defining the delivery internal name through whereas I would need it to pick up the internal name automatically instead of hardcoding it (instance.vars.deliveryIN = vars.deliveryinternalName) but I don't seem to be able to get this to work.

    I've also tried to define a variable in the delivery itself and again can get this to print out as a personalised variable in the email itself so I know the right info is there. I don't seem to be able to then reference this variable in the target data after the delivery.
     
  2. The second issue is that when doing an AB test the third delivery which sends the 'winner' does not pass through the  'Foreign Key of the link 'Message' (field 'id') field. that the other deliveries do. However if I can get it to pass through the delivery internal name field then this is no longer an issue.   

Avatar

Level 3

Hi, 

Below might help 

1. to retrieve internal name for any workflow activity you need to use activity.name,this might work for you

2.  For AB testing, you can find more detail on below link. You can use delivery code for AB testing

https://docs.campaign.adobe.com/doc/AC6.1/en/WKF_Use_cases_A-B_testing.html

Regards,

Ankur A.

Avatar

Level 3

Hi,

Thanks for the reply.

I don't seem to be able to put together the correct syntax to find my variable. If I create the variable in the Delivery in the 'variable' tab how do I then call this in a later activity as nothing I'm doing seems to be working.

Thanks for the link on AB testing. AB testing is working perfectly, my only concern was that the winning delivery was not outputting the foreign key to the message table - unlike the normal deliveries.

Avatar

Level 3

I am not sure about message table not having delivery.

But, I can help with defining the variable in delivery and using it later in your workflow. To define a variable in delivery activity, Right click on delivery and click open. It will open a generic workflow activity form instead of delivery form. You can define variables in script tab of this form, it variables will be available in your workflow later on.

As per my understanding variables define in delivery variable tab are only available with in delivery. 

I hope it helps.

Regards,

Ankur A.

Avatar

Level 3

Hi Ankur,

To clarify here are my steps.

  • Create workflow > properties > click 'keep the results of the interim populations between two executions'
  • Create delivery
  • Right click delivery > Open > Click script and enter 'instance.vars.deliveryIN = vars.deliveryinternalName'
  • Click 'generate an outbound transition'
  • Create an enrichment after the delivery
  • Create a new field DevID = $(instance/vars/@deliveryIN)
  • Run delivery
  • Right click the target data from the enrichment. 
  • DevId is usually blank or has 'undefined'

Thoughts? 

Avatar

Level 3

alistairk39680404 wrote...

Hi Ankur,

To clarify here are my steps.

  • Create workflow > properties > click 'keep the results of the interim populations between two executions'
  • Create delivery
  • Right click delivery > Open > Click script and enter 'instance.vars.deliveryIN = vars.deliveryinternalName'
  • Click 'generate an outbound transition'
  • Create an enrichment after the delivery
  • Create a new field DevID = $(instance/vars/@deliveryIN)
  • Run delivery
  • Right click the target data from the enrichment. 
  • DevId is usually blank or has 'undefined'

Thoughts? 

 

Use 'delivery.id' or 'delivery.internalName' instead of  $(instance/vars/@deliveryIN). It should work. 

Avatar

Level 3

This below statement passes through the Delivery ID (which will work for what I need)

$(vars/@deliveryId)

However I would like to understand how to get the delivery internal name to be referenced. Do I need to define this as a different type of variable? 

All the below return null values whilst the deliveryId works.

$(vars/@deliveryinternalName)
$(vars/@deliveryInternalName)
$(vars/@deliveryinternalname)
$(vars/@deliveryInternalname)

Avatar

Correct answer by
Employee Advisor

Hi Alistair,

I have a solution which is more of a hack, not elegant but should serve your purpose.

  1. I've implemented this in a single transition but you can duplicate the setup for multiple deliveries.
  2. Create a transition with JS activity (to define instance variable and initialize it), query activity to pick target audience, Enrichment to add our variable to the transition, delivery (with content).
  3. We will dynamically set the internal name of delivery in our workflow. In other words, the internal name generated by campaign will be dynamically overridden to the one we initialize in JS activity, 
  4. Please refer to this image to see the whole setup and how it works. 
  5. Inside JS code activity initialize the instance variable which will contain the internal name we wish for delivery in the transition.
    instance.vars.dynamicInternalName = "delivery1"

     

  6. Inside Enrichment define variable to be added to output transition.

  7. Right click on the delivery activity and click on Open option to view the Initialization Script section. Use the following code to dynamically change the delivery internal name 

    delivery.internalName = instance.vars.dynamicInternalName

     

  8. Execute the workflow, delivery will be created with internal name of our choice. Also, the output transition will contain this internal name becuase of the hack done inside Enrichment.

Hope this helps.

Regards,

Vipul

Avatar

Level 2

The "Email Delivery" activity doesn't contain the "Script" tab where in to enter Delivery object modification script:

Email Delivery activity.png

But rather the "Delivery" activity:

delivery modification scirpt.png

How does one obtain the Script tab inside the "Email Activity"?