Campaign App Preview Integration

Last updated 2 months ago

Learn how to integrate your campaign-ready preview into the CoreMedia Campaign App.

Prerequisites

  • Access to CoreMedia Studio CMCC 11, (recommended) version 2210 or higher

  • A campaign-ready preview delivery that supports both the scenarios for previewing a single localized campaign (Query.previewCampaign) and for previewing campaign-managed content items from multiple campaigns (Query.previewCampaignContent) as described in Delivery GraphQL API

Campaign App Preview Use Cases

The CoreMedia Campaign App features two use cases for previewing campaigns.

Previewing a Single Localized Campaign

This use case is triggered when a user clicks on the "Open Preview" button in the localized campaign details view. A new Campaign App preview window is opened that displays the localized campaign’s site including the content items managed by this localized campaign.

As shown in the picture of the preview’s header below, it is possible to switch between different previews (if defined, see below). It is also possible to switch between the different localized variants of the same campaign.

campaign app preview single campaign header

Previewing Campaign-Managed Content Items from Multiple Campaigns

This use case is triggered when a user clicks on the "Open Preview" button in the campaign timeline view. A new Campaign App preview window is opened that displays the campaign-managed content items from all localized campaigns that include the date that is the center of the timeline view.

As shown in the picture of the preview’s header below, it is once again possible to switch between the different previews (if defined, see below). In addition, it is possible to switch the site and the preview date.

campaign app preview multi campaign header

Configuration

In both use cases described above, the Campaign App opens a new window where the actual preview is embedded in an iframe. The URL of this iframe is configured in the usual way that preview URLs are configured for CoreMedia Studio, cf. "Customizing CoreMedia Studio > Multiple Previews Configuration" in the "Studio Developer Manual".

To support the use case where one single localized campaign is previewed, the embedded preview URL receives an additional hash parameter localizedCampaignId. To support the use case where multiple campaigns are previewed for a specific date, the embedded preview URL receives additional hash parameters for the preview date. In this case, two hash parameters are added: previewDateISO with the preview date in ISO format and previewDate with the preview date in the proprietary or legacy format that CoreMedia Studio uses for the preview date.

As usual when configuring previews for CoreMedia Studio, you can also use these hash parameters as template values to appear differently in your preview URL. In the example below, the genericStudioPreviewProvider is used to provide the localized campaign id as a different hash parameter (campaign) in the URL.

campaign app preview config example

Note: Be careful when using localizedCampaignId or previewDateISO / previewDate as values for path segments in URL templates. They are not always defined and will then be substituted with an empty string: in the single campaign preview case, previewDateISO / previewDate is not defined and in the multi-campaign preview case, localizedCampaignId is not defined.

Copyright © 2024 CoreMedia GmbH, CoreMedia Corporation. All Rights Reserved.