Add contextual attributes to published fragments adding-contextual-attributes
By default, adding new personalization attributes to a published fragment is not supported. Once a fragment is published, the set of profile or contextual attributes is locked for all campaigns and journeys.
However, for select customers, it is possible to add contextual attributes only to published fragments.
Guardrails and limitations limitations
- Make sure all journeys and campaigns that currently use the fragment can handle the new contextual attributes.
- Profile attributes cannot be added to published fragments. Only contextual attributes are supported.
- Contextual attributes must be manually entered into the code editor—they cannot be selected from the personalization editor UI.
- When adding personalized attributes to live fragments, validations are relaxed, which means errors may not be detected and could cause unintended breakages at scale.
- Once published, any errors will immediately impact all communications using that fragment.
Add contextual attributes add-contextual-attributes
To add contextual attributes to a published fragment, follow the steps below.
-
Navigate to Content Management > Fragments.
-
Select the published fragment and click Modify to create a draft version.
{align="left" width="70%"}
-
Click Edit to open the fragment content editor.
-
Switch to Code editor or Advanced mode in the personalization editor.
-
Manually type or copy-paste the contextual attribute using the
{{context.attribute_name}}syntax:Example for a
promotionCodeattribute:code language-none {{context.promotionCode}}note caution CAUTION Double-check the attribute path for accuracy. Errors may not be detected and could disrupt journey or campaign communications at scale. -
Save your changes.
-
Once confirmed, click Publish to make your changes live.