Configuration

Creating managed campaigns requires the proper configurations to be in place first. Three configuration steps are involved in using campaigns on sites.

Creating campaign templates

Campaign templates typically contain a default header and footers to give authors visual feedback on how the campaign will appear.

To make sure that the default headers and footers are not included when the campaign is displayed on a page, the following tags should be applied in your campaign template:

magnolia-ecommerce-templates:pages/campaign
<!DOCTYPE html>

<html lang="en">
    <head>
        [@cms.page /] (1)
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    </head>

    <body>
        [#-- Page content --]
        [@cms.area name="main"/] (2)
    </body>
</html>
1 Added to the <head> element of the page, it enables the page dialog.
2 This tag is for the main area where the campaign content is inserted.
Remember to create an FTL file if you’re using Freemarker to render your content.

Registering campaign templates

Register your campaign template by adding it under the campaign-manager module in the Configuration app, as shown below.

Node name Value

📁 modules

     📁 campaign-manager

         ⸬ config

             ⸬ templates

                 ⬩ corporate-website

demo-corporate-decorations:pages/managed-campaign

This is the template for creating your campaign slot in the Campaign Manager.

Configuring slots in page templates

The Campaign Manager module has a pre-configured template for linking campaigns to sites. Any matching slot content in the Campaign Manager can fill managed campaign slots on your website.

To configure these managed campaign slots, add the pre-configured template to a component in the page area where you want to add a campaign, as outlined in the steps below.

  1. Open your site’s page template.

  2. Find the area you want to add a campaign.

  3. Add the template id: campaign-manager:components/managed-campaign to a new component in that area.

Page template for your website
...
  main: (1)
    availableComponents:
      html:
        id: mtk2:components/html
      linkList:
        id: mtk2:components/linkList
      teaser:
        id: mtk2:components/teaser
      video:
        id: mtk2:components/video
      pageIntro:
        id: mtk2:components/pageIntro
      manageCampaign: (2)
        id: campaign-manager:components/managed-campaign (3)
1 Ensure the main is placed at the top of your areas in your template file. Otherwise, it may fail when creating a new campaign.
2 A new component for the managed campaign slot.
3 The template id for a managed campaign slot.
Feedback

DX Core

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the Campaign manager module docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules