Page tree
Skip to end of metadata
Go to start of metadata

The Campaign Manager module allows you to create, manage and schedule campaigns and rich banners in one place with comprehensive editing options.

Use the Campaign Manager module to craft appealing campaigns with complex layouts.

Each campaign you create is essentially a component you can then use in a page. While content apps focus on managing structured content, the Campaign Manager module provides an authoring experience similar to that of the Pages editor with visual feedback and layout capabilities.

Installation

Maven is the easiest way to install the module. Add the following dependency to your bundle:

<dependency>
  <groupId>info.magnolia.campaign</groupId>
  <artifactId>magnolia-campaign-manager</artifactId>
  <version>${campaignManagerVersion}</version>
</dependency>

Versions

3.1.4Magnolia 6.2.6
3.0.8Magnolia 6.1
2.0.6Magnolia 5.7
2.0.6Magnolia 5.6.4

Usage

Creating managed campaigns requires the proper configurations to be in place first.

/campaign-manager/config.yaml
templates:
  basic: mtk:pages/basic


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 /]
        <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"/]
    </body>
</html>

Creating Campaigns

From the Campaign Manager app you can create and manage campaigns. Click Add campaign schedule to add a new campaign. You are required to provide the following parameters for a new campaign:

  • Name: Give your campaign a meaningful name so that content editors are able to tell one campaign from another.
  • Description: Set a meaningful description to help the other editors to understand the purpose of the campaign
  • Priority: In case of overlapping campaigns, the system will use that property to prioritise the campaigns
  • Color:  The color to use to identify the campaign in the consolidate calendar view
  • Schedule: Give the campaign schedule

The campaign acts as a container for the campaign items (aka Creatives). A campaign item is an element of the campaign for defining content. You are required to provide the following parameters for a new campaign item:

  • Name: Each campaign item should define a meaningful name. In most cases "Banner" can be used as a name.
  • Template: Select the campaign template to be used. Campaign templates are defined in the module config here.
  • Tag: Tagging helps identify campaigns of a certain type or category.

Using Campaigns on Sites

The Campaign Manager module comes with a component template for linking campaigns to sites. Simply make the component available in the area of page where you would like to add a campaign. 

Simple use the id of the template:

id: campaign-manager:components/managed-campaign

Integration

Server side rendering mode (Freemarker templates)

If you use the Magnolia server side rendering mode then the managed campaign component's area will resolve by itself which campaign to display according to the HTTP request execution date.

Headless mode

If you use the Magnolia headless mode, you will have to define the following references resolvers in your delivery endpoint.

delivery-endpoint.yaml
references:
  # For the matching campaign resolution
  - name: campaignReference
    propertyName: tag
    referenceResolver:
      class: info.magnolia.campaign.manager.rest.reference.CampaignReferenceResolverDefinition

  # For the fallback campaign resolution (if used) 
  - name: campaignFallbackReference
    propertyName: fallback
    referenceResolver:
      class: info.magnolia.rest.reference.jcr.JcrReferenceResolverDefinition
      targetWorkspace: campaign-manager


Then, as the other page components, you will need to map the Magnolia components defined in the campaign item  with their related Javascript components.

Sample of json response:

response-extract.json
"04": {
    "@name": "04",
    "@path": "/home/main/04",
    "@id": "9dbd0f9e-b4ac-431b-b7d5-82a9b8eabdc6",
    "@nodeType": "mgnl:component",
    "tag": {
        "@name": "Welcome-back",
        "@path": "/welcome-back/Welcome-back",
        "@id": "c9e561d5-fb02-4370-a487-c53a0b4b027d",
        "@nodeType": "campaign-item",
        "tag": "258c7a63-0f07-4321-b6b0-4986b52f32aa",
        "name": "Welcome back",
        "mgnl:template": "headless-ecommerce:pages/ManagedCampaign",
        "main": {
            "@name": "main",
            "@path": "/welcome-back/Welcome-back/main",
            "@id": "22b5782d-f876-45e9-b843-500f75b92118",
            "@nodeType": "mgnl:area",
            "0": {
                "@name": "0",
                "@path": "/welcome-back/Welcome-back/main/0",
                "@id": "676f6a7e-8bab-4b85-837d-2d69d5359167",
                "@nodeType": "mgnl:component",
                "mgnl:template": "headless-ecommerce:components/Banner",
                "subtitle": "We're safely reopening our stores and reintroducing in-store shopping.",
                "isLarge": "false",
                "title": "WELCOME BACK SALE",
                "image": "jcr:23a7ef00-f6c9-4f26-808f-356b41791c74",
                "cta": {
                    "@name": "cta",
                    "@path": "/welcome-back/Welcome-back/main/0/cta",
                    "@id": "d8bea341-e2f7-4c48-9a6a-bdb5142fbfa7",
                    "@nodeType": "mgnl:contentNode",
                    "link": "4ff81f1f-b515-4433-8b0e-b108348e9b38",
                    "text": "SHOP AND GET DISCOUNTS",
                    "@nodes": []
                },
                "@nodes": [
                    "cta"
                ]
            },
            "@nodes": [
                "0"
            ]
        },
        "@nodes": [
            "main"
        ]
    },
    "mgnl:template": "campaign-manager:components/managed-campaign",
    "masterContent": "true",
    "skip": "false",
    "@nodes": []
}


Warnings

  • This module is at INCUBATOR level.
  • Versions prior to 2.0.4
    • Used a different artifactId. Please make note of the change.
    • Used a version of the template-extended module which had a different artifactId. Be sure you don't have templating-extended.jar in your classpath after updating.

Changelog

  • Version 3.1.4
  • Version 3.1.3
  • Version 3.1.2
  • Version 3.1
  • Version 3.0.2
  • Version 2.1.1
    • CAMPMAN-7 - Getting issue details... STATUS
  • Version 2.1
    • Updated for Magnolia 6.0 compatibility.
  • Version 2.0.6
    • Default action added to browser subapp
  • Version 2.0.5
    • Added missing keys and labels
  • Version 2.0.4 - Initial release of the extensions version of the module.