Skip to main content
Level 2
Nov 24, 2021 4:57 PM UTC
Solved

Previewing Target.Data in a delivery

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!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
david--garcia
david--garciaAccepted solution
Level 10
Nov 26, 2021 4:22 AM UTC
<% 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

 

 

 

https://www.linkedin.com/in/david-garcia-uk/ | https://martech.network

2 replies

ChrisA93Author
Level 2
Nov 24, 2021 5:06 PM UTC

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

Translate
david--garcia
david--garciaAccepted solution
Level 10
Nov 26, 2021 4:22 AM UTC
<% 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

 

 

 

Translate
https://www.linkedin.com/in/david-garcia-uk/ | https://martech.network