- 1 Minute to read
- Print
- DarkLight
Personalization with Related Data
- 1 Minute to read
- Print
- DarkLight
Overview
Using related data allows you to personalize messages dynamically based on stored data sets. This enhances engagement by tailoring content to recipients' behavior, preferences, or historical interactions.
How Personalization with Related Data Works
Placeholders: Insert individual data into a message using placeholders.
Personalization Rules (InsertIf & InsertElse): Define conditions for when specific content is displayed.
Boolean Expressions: Evaluate conditions using logical operations (e.g., the contact has made a purchase, is within a specific segment, etc.).
Dynamic Content: Change email content based on recipient-specific data stored in related data sets.
Constructing Personalization Rules
Basic Personalization Rule
<%InsertIf expression="${function}"%>Personalized Content<%/InsertIf%>
The InsertIf tag defines when content should be displayed.
The expression attribute holds the condition.
The InsertElse tag allows for fallback content.
Example 1: Targeting Customers Who Purchased Shoes
<%InsertIf expression="${ecm:countMapElements(ecx:filter(user.RelatedAttribute['Purchases']['ArticleType'], 'Shoes'))}"%>
Special offer on shoe accessories!
<%/InsertIf%>
Example 2: Targeting Customers Who Purchased in the Last Month
<%InsertIf expression="${ecm:countMapElements(ecx:filter(user.RelatedAttribute['Purchases']['Date'], ecm:formatDate(ecm:subtractInterval(date['Today'], 'P1M'))))}"%>
Exclusive deal for recent buyers!
<%/InsertIf%>
Example 3: Default Offer for All Other Contacts
<%InsertElse%>Check out our latest deals!<%/InsertElse%>
Best Practices
✔ Use InsertIf and InsertElse to create dynamic experiences.
✔ Keep conditions simple to ensure efficient rendering.
✔ Store reusable personalization rules in the code view for consistency.
✔ Test conditions in a staging environment before deploying to production.