Expand my Community achievements bar.

SOLVED

Adding targetData logic in an email

Avatar

Level 1

Hi I'm very new to ACS, and was hoping someone can help me out.  I built an email and I'm trying to access targetData in the email for the make and model of a car.  I put the code below in the email (I tried "context.targetData" and "context.profile.targetData") and I just get back when I preview "'targetData' element unknown (see definition of 'Enrichment (temp:enrichment1-src)' schema)."  How do I fix this please?

 

<% var aVehicle = 'vehicle';
var aField1 = targetData.Make;
var aField2 = targetData.Model;
if( aField1 != '' || aField2 != '') { aVehicle = aField1 + ' ' + aField2; } document.write(aVehicle); %>
1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

indeed you can't configure target data on test profiles

 

To test it completly, you need to use profile substitution feature:

https://experienceleague.adobe.com/docs/campaign-standard-learn/tutorials/communication-channels/ema...

View solution in original post

2 Replies

Avatar

Level 1

I wasn't using the entire variable being pulled in from targetData.  It should have been:

 

context.targetData.cusWorkOrderLink1.Make;
 
Now I'm just having trouble testing with the test profiles since none of them have the data.

Avatar

Correct answer by
Employee Advisor

indeed you can't configure target data on test profiles

 

To test it completly, you need to use profile substitution feature:

https://experienceleague.adobe.com/docs/campaign-standard-learn/tutorials/communication-channels/ema...