Expand my Community achievements bar.

SOLVED

Can you use a variable / target data in a delivery label?

Avatar

Level 2

We have two groups of customers who are being emailed the same html, so it make sense to send them the same email delivery that contains this html. But we want to track the email engagement of each group separately. To achieve this we currently create two email deliveries with two different delivery labels and then load the same html into both deliveries. Is there any way to use just one email delivery but to pass through a variable for each group into the delivery label? 

 

Thanks.

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @paul_wotton,

you can change the delivery label, or delivery code depending on any shared date in your segment coming from the targetData. It is undocumented feature but works since forever. 

  • split your target in any segments with split add your segment code to the segment code section in split
  • feed all the transitions into empty JS script activity
  • connect JS activity with you delivery activity, that is under the 'folder tree icon' 

       Marcel_Szimonisz_3-1648629805460.png

 

  • in delivery modification script query your segment code from the target data to make delivery of same content but differentiate with delivery code or label or anything you that is required

       

var getSegmentName = function(name){
    if( name === undefined)
      logError("Argument 'name' is required."); 
    
    try{
      var res = sqlSelect("targetData,@" + name + ":string",
          "select " + name + " from " + vars.tableName + " GROUP BY " + name);
      return res.targetData[0]['@'+ name].toString();
    }catch(e){
      logWarning("Segment name '" + name + "' does not exist in the targeting table.");
      return false;
    }
}
var mySegment = getSegmentName("sSegmentCode");
delivery.deliveryCode = delivery.deliveryCode + mySegment;
delivery.label = delivery.label + mySegment;

//do not forget establish the link as for this type of activity link is not created automatically
delivery.operation_id = instance.operation_id;
delivery.workflow_id = instance.id;

 

Notes:

 

When you run this workflow it will create as many deliveries as many split transitions you have created.

 

Your workflow should end up looking like:

Marcel_Szimonisz_0-1648629347932.png

Segments are set in split as follwing:

Marcel_Szimonisz_1-1648629400473.png

 

SQL fields:

The SQL field names you want to add to the delivery can be found when you explore the population schema in your workflow.

Marcel_Szimonisz_2-1648629552629.png

 

Marcel Szimonisz

MarTech Consultant
for more tips visit my blog
https://www.martechnotes.com/

View solution in original post

7 Replies

Avatar

Community Advisor

Hi Paul, 

Not OOTB, but you can add a segment code to your broadLogRcp schema to collect segment code created during your workflow and use this segment code to group by in your engagement report.

 

Thanks,

David



David Kangni

Avatar

Correct answer by
Community Advisor

Hello @paul_wotton,

you can change the delivery label, or delivery code depending on any shared date in your segment coming from the targetData. It is undocumented feature but works since forever. 

  • split your target in any segments with split add your segment code to the segment code section in split
  • feed all the transitions into empty JS script activity
  • connect JS activity with you delivery activity, that is under the 'folder tree icon' 

       Marcel_Szimonisz_3-1648629805460.png

 

  • in delivery modification script query your segment code from the target data to make delivery of same content but differentiate with delivery code or label or anything you that is required

       

var getSegmentName = function(name){
    if( name === undefined)
      logError("Argument 'name' is required."); 
    
    try{
      var res = sqlSelect("targetData,@" + name + ":string",
          "select " + name + " from " + vars.tableName + " GROUP BY " + name);
      return res.targetData[0]['@'+ name].toString();
    }catch(e){
      logWarning("Segment name '" + name + "' does not exist in the targeting table.");
      return false;
    }
}
var mySegment = getSegmentName("sSegmentCode");
delivery.deliveryCode = delivery.deliveryCode + mySegment;
delivery.label = delivery.label + mySegment;

//do not forget establish the link as for this type of activity link is not created automatically
delivery.operation_id = instance.operation_id;
delivery.workflow_id = instance.id;

 

Notes:

 

When you run this workflow it will create as many deliveries as many split transitions you have created.

 

Your workflow should end up looking like:

Marcel_Szimonisz_0-1648629347932.png

Segments are set in split as follwing:

Marcel_Szimonisz_1-1648629400473.png

 

SQL fields:

The SQL field names you want to add to the delivery can be found when you explore the population schema in your workflow.

Marcel_Szimonisz_2-1648629552629.png

 

Marcel Szimonisz

MarTech Consultant
for more tips visit my blog
https://www.martechnotes.com/

Avatar

Level 2

Thanks for your reply Marcel. Although I was able to implement your suggestions, the result was the same in that both groups of customers are given the same delivery label and delivery code.

 

In the target data I can see customers are being assigned different segment codes depending on which segment they are in and a segment code is being pulled into the delivery label and delivery code. However, it is the same delivery label and delivery code for all customers.

 

I'm happy to try other suggestions but could it ultimately be that this isn't possible to achieve because Adobe Campaign will only ever assign a single delivery label and delivery code to a delivery?

Avatar

Community Advisor

Hello @paul_wotton 

You are doing something wrong. I use this for years. Can you share the screen shot? and also the place you change the label? Has to be added in second tab on delivery activity.. also the activity is not "Email delivery" but delivery where you create new send from template.

 

Marcel

Avatar

Level 2

 

Hi Marcel,

 

The campaign workflow takes two customers

screenshot1.jpgscreenshot1.jpg

splits 50% to the subset which is assigned a segment code

screenshot2.jpgscreenshot2.jpg

and the remaining 50% to the complement which has a different segment code

screenshot3.jpgscreenshot3.jpg

The javascript activity is empty

The Delivery is set to New, created from a template

screenshot4.jpgscreenshot4.jpg

The coding has been added to the Delivery Script

screenshot5.jpgscreenshot5.jpg

After running the workflow there is only one delivery created

screenshot6.jpgscreenshot6.jpg

This delivery is being sent to both customers. There is not another delivery containing the other segment code in the label. If you have any other suggestions I'm more than happy to try them.

 

Thanks, Paul

 

Avatar

Community Advisor

it's not the same as I posted. Remove the union and connect two transitions from split to empty javascript activity then to delivery and run it to see two deliveries created

Avatar

Level 2

**bleep** unions  thanks for persevering with me as your solution has worked now that I've removed the union. Thanks for your help.