Personalization—Campaign Variants
In this tutorial you learn how to personalize content in the Campaign Manager. The scenario focuses on delivering tailored content to visitors from specific countries within a defined time period. You will learn how to create content variants, define target audiences, and validate the campaign behavior using the Preview app.
Variant resolver filter
The original variant resolver filter (info.magnolia.personalization.filter.VariantResolverFilter) handled only variants originating from the website workspace.
The Campaign Manager module replaces this resolver with info.magnolia.campaign.manager.personalization.filter.VariantResolverFilter, which supports multiple workspaces. Supported workspaces are configured in the filter via a supportedWorkspaces map, where keys such as website and campaign-manager are mapped to their corresponding node types (e.g. website→mgnl:page and campaign-manager→campaign-item).
Component variant creation in a campaign creative
Follow these steps to create personalized variants for a campaign creative component:
-
Create a new campaign and a creative in the Campaign Manager app.
-
In the creative’s main area, create and select a component to personalize.
-
Create two personalized variants of the selected component. In each variant, add content that is relevant and appealing to the intended audience.
-
Define the United Kingdom and China as target countries using the Country trait.
-
Configure the variants to be active during a specific time period using the Date trait.
Creative variants creation
Follow these steps to create personalized variants for a campaign creative:
| Please note that a creative cannot create variants if it contains components that already have variants. |
-
Create a new campaign and a creative in the Campaign Manager app.
-
Create two personalized variants of the selected creative. In each variant, add content that is relevant and appealing to the intended audience.
-
Define the United Kingdom and China as target countries using the Country trait.
-
Configure the variants to be active during a specific time period using the Date trait.
Preview the variants
Use the Preview app to verify that the correct variant is delivered based on audience and date conditions:
-
In the Pages app, assign the newly created campaign to a page.
-
Open the Preview app.
-
Navigate to the page that contains the campaign.
-
Expected result: The original (non-personalized) campaign component is displayed.
-
-
Select a Chinese persona.
-
Expected result: The original page is still displayed because no matching date is defined.
-
-
Set the preview date to a value that falls within the run dates configured for the Chinese variant.
-
Expected result: The Chinese variant is displayed.
-
-
Change the persona country to the United Kingdom and set a date that falls within the United Kingdom variant run period.
-
Expected result: The United Kingdom variant is displayed.
-