Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Previewing Target.Data in a delivery

ChrisA93
Level 2
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
David__Garcia
Correct answer by
Level 9
Level 9
<% 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
ChrisA93
Level 2
Level 2

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

David__Garcia
Correct answer by
Level 9
Level 9
<% 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