Use decision policies in messages create-decision
Once you’ve added a decision policy to your content, you can use attributes from returned decision items for personalization. To do so, first insert the decision policy code into your content.
Insert the decision policy code insert
-
Edit your code-based experience and navigate to Decision policy.
-
Select Insert policy to add the decision policy code.
| note note |
|---|
| NOTE |
| For code-based experiences, if your decision policy contains decision items including fragments, you can leverage these fragments in the decision policy code. Learn how to leverage fragments |
-
Open the Personalization Editor and navigate to Decision policies.
-
Select Insert syntax to add the code for your decision policy.
note note NOTE If the insertion option doesn’t appear, a decision policy might already be configured for the parent component. -
If no placement has been assigned yet to the component, select one from the list and click Assign.
note note NOTE If you use multiple decision policies in the same email (for example, one for the header and one for the footer), the same offer is deduplicated across placements: each area receives a different offer. To show the same offer in multiple areas, use Reuse decision output when adding a decision policy. Learn how to create decision policies.
-
Open the Personalization Editor and navigate to Decision policies.
-
Select Insert syntax to add the code for your decision policy.
-
Open the Personalization Editor and navigate to Decision policies.
-
Select Insert syntax to add the code for your decision policy.
| note important |
|---|
| IMPORTANT |
| Experience Decisioning with push notifications requires a specific version of the Mobile SDK. Before implementing this feature, check the release notes to identify the required version and ensure you have upgraded accordingly. You can also view all available SDK versions for your platform in this section. |
The decision policy code is added. You can now use attributes from the returned decision items to personalize your content.
Personalize with decision item attributes attributes
After you’ve added the code for a decision policy in your content, all attributes from the returned decision items become available for personalization. Learn how to work with personalization.
Attributes are stored in the “Offers” catalog schema. They display in the following folders from the personalization editor:
- Custom attributes:
_\<imsOrg\>folder - Standard attributes:
_experiencefolder
Decision item attributes and contextual attributes are not supported by default in Journey Optimizer fragments. However, you can use global variables instead, such as described below.
To add an attribute, click the + icon next to the attribute. You can add as many attributes as needed. You can also include other personalization attributes, such as profile data.
-
For Email and Code-based channels, wrap the attributes within the
#eachloop using square brackets[ ], and add a comma before the closing/eachtag.accordion See example
-
For SMS and Push channels, make sure you insert attributes after the syntax code for the decision policy. This syntax should always be kept at line 1.
accordion See example
note note NOTE If you insert an image asset attribute in SMS or Push content (for example, in the title or body), the attribute value displays as a URL. The image itself is not rendered in those fields. -
To enable decision item tracking, add the
trackingTokenattribute:trackingToken: {{item._experience.decisioning.decisionitem.trackingToken}}
Preview & test your content
After building your content, preview and test it before activating your journey or campaign. Decision items render based on selected profiles in the simulation interface. Learn how to preview and test content.
Next steps final-steps
Once your content is ready, review and publish your campaign or journey:
For code-based experiences, as soon as your developer makes an API or SDK call to fetch content for the surface defined in your channel configuration, the changes will be applied to your web page or app.
Use reporting dashboards
To see how your decisions are performing, you can view out-of-the-box decisioning metrics in the campaign or journey report, or build custom Customer Journey Analytics dashboards to measure performance and gain insights into how your decision policies and offers are delivered and engaged with. Learn more about Decisioning reporting.