Introduction
CIJ Emails allow for very flexible creation of personalized content. Depending on rules defined in the editor, a single email could have multiple variations of its content depending on the target audience. From sections of content only applicable to certain segments or images based on contact attributes, it is possible to define rules that present variable content (see How to use conditional content - Dynamics 365 Customer Insights | Microsoft Learn). Complementing this capabilities, email analytics allow users to review what variation was used with each email sent to each contact. With the ability to build custom reports using Microsoft Fabric integration, customers opting to create custom reports will require an understanding how each variation is represented in the email configuration. This becomes important as it is necessary to correlate the configuration on the email with the email interactions (i.e. delivered, sent, clicked).
{
"@version": "1.0",
"conditionalContent":
[
{
"defaultVariant":
{
"isEnabled": true
},
"id": "033be32f-a04d-4e8e-b9ee-1b30abc94042",
"type": "section",
"variants":
[
{
"isEnabled": true,
"ruleId": 1
}
]
}
],
"lastIdUsed": 3,
"rules":
{
"Content for Ryan":
{
"id": 1,
"name": "Content for Ryan",
"placeholderLabel": "conditionalRule_1"
}
},
"variations":
{
"Default":
{
"id": 3,
"name": "Default",
"ruleIds":
[
0
]
},
"Ryan's Content":
{
"id": 2,
"name": "Ryan's Content",
"ruleIds":
[
1
]
}
}
}
The JSON has the following contents
Conditional Content
Problem definition
When exploring the data in Fabric, email interactions (like Email Sent) contain a field that indicates which variation was sent to a given contact. However, this field only has an identifier or identifiers (if multiple conditional content blocks exist) for the variation(or variations) not the variation(s) name themselves. To determine the variation name used, it becomes necessary to review the Email definition which is available in the msdynmkt_email table. In this table, the field msdynmkt_conditionalcontent will have the definition of all variations.
To describe this, let’s start with a simple email that has two variations: One Default variation for most customers and one variation for customers named “Ryan” so that they receive a different image. This is what such email would look like.
Now that we have two variations of the same email, let’s go over naming them. This is possible from the Preview and Test tab which will allow us to select the conditional content variations and provide a name for them.
To describe this, let’s start with a simple email that has two variations: One Default variation for most customers and one variation for customers named “Ryan” so that they receive a different image. This is what such email would look like.
Now that we have two variations of the same email, let’s go over naming them. This is possible from the Preview and Test tab which will allow us to select the conditional content variations and provide a name for them.
Important note
The information provided in the subsequent sections is pre-release information and is subject to change.Email Variation Definition
The content of the msdynmkt_conditionalcontent field is a JSON text which describes the available variations for an email. For the example, this what this JSON would look like:{
"@version": "1.0",
"conditionalContent":
[
{
"defaultVariant":
{
"isEnabled": true
},
"id": "033be32f-a04d-4e8e-b9ee-1b30abc94042",
"type": "section",
"variants":
[
{
"isEnabled": true,
"ruleId": 1
}
]
}
],
"lastIdUsed": 3,
"rules":
{
"Content for Ryan":
{
"id": 1,
"name": "Content for Ryan",
"placeholderLabel": "conditionalRule_1"
}
},
"variations":
{
"Default":
{
"id": 3,
"name": "Default",
"ruleIds":
[
0
]
},
"Ryan's Content":
{
"id": 2,
"name": "Ryan's Content",
"ruleIds":
[
1
]
}
}
}
The JSON has the following contents
Conditional Content
- List of all conditional content in the email (conditional sections, images), each conditional content has variants (for an image each variant could be a different picture)
- id: this is the id of the conditional content in the html of the email
- defaultVariant: if default is enabled (when no rule matches this is what is send)
- type: conditional content type: image, section
- variants: The list of variants and what rule they use, the variants in the conditional content are evaluated in order and first variant with matching rule is selected, if none matches the default is taken if default is enabled
- Rules refer to the definition used across all conditional content in the email
- name: that is how user named the rule when creating the condition
- placeholderLabel: This is the name of the placeholder in msdynmkt_placeholders field on the email entity that contains the definition of the condition
- id: this number is the id of the rule
- These are the named variations. As mentioned, these would be named in the email preview.
- name: is the name of the variation
- ruleIds: This is the list of rules this variation is combined from, the index in the array represents the conditional content in the conditionalContent array, so a variation with rules [1, 2] means that for first conditional content rule 1 was used and for second conditional content rule 2 was used.
- id: The id of the variation
Email interactions
In the email interactions tables, along with the details of date of the interaction, there are fields to identify the email message sent (Message Id) and the variation (MessageVariationIndexes, MessageVariationName). Below is an example of the contents of the table.
As shown in the screenshot, messageid will contain the GUID of the email record in the msdnmkt_email table and MessageVariatonIndexes will have the identifier of the variation sent with the following logic.
From the interaction you can get 2 different formats:
From the interaction you can get 2 different formats:
- A string starting with V and the id of the variation. In the example above, we have variation 2 (Ryan’s Content) or 3 (Default) so interactions would have "V3" or “V2”
- If variations were not named, a string containing numbers separated with dash (-) like "0-2" or "1-null". The numbers represent the used ruleIds for the conditional content of the email with 0 representing the default. For example, "0-2" the 0 is default for the first conditional content and the 2 indicates that rule 2 was applied for the second conditional content. If one of the values around the dash is null, this means none of the rules matched and that conditional content disabled de default variation
*This post is locked for comments