Expand my Community achievements bar.

SOLVED

Previewing Target.Data in a delivery

Avatar

Level 2

Hi,

 

Very basic example, but i am trying to add in conditional personalisation using target data. I've created a segment code based on value (H,M,L).

 

I've then inserted the following into my HTML but can't preview for customers who are targeted (e.g. recipient segment code = 'H', nothing shows in preview).

 

<%if ( targetData.segmentCode == 'H' ) { %>20%<%

 

I've done this before but totally forgot how so hoping this will be a quick fix!

1 Accepted Solution

Avatar

Correct answer by
Level 10
<% if (targetData.segmentCode =='H' ) { %> 20% <% } else  if (targetData.segmentCode =='M' ) { %> 30% <% } else if (targetData.segmentCode =='L' ) { %> 40% <%}%>

If you want to preview, choose a seed, then add segmentCode to seed's additional data

David__Garcia_0-1638163677081.png

 

David__Garcia_3-1638163825692.png

 

 

View solution in original post

2 Replies

Avatar

Level 2

Just to be clear this is in the delivery preview where I can't see the targeted content by segment code.

Avatar

Correct answer by
Level 10
<% if (targetData.segmentCode =='H' ) { %> 20% <% } else  if (targetData.segmentCode =='M' ) { %> 30% <% } else if (targetData.segmentCode =='L' ) { %> 40% <%}%>

If you want to preview, choose a seed, then add segmentCode to seed's additional data

David__Garcia_0-1638163677081.png

 

David__Garcia_3-1638163825692.png