Skip to main content

Introduction

Adobe Experience Manager (AEM) is an enterprise content management platform that enables organizations to create, manage, and deliver personalized digital experiences across multiple channels.

AEM and MoEngage

The integration connects AEM to MoEngage via a custom workflow process, allowing real-time content synchronization from AEM to MoEngage Content Blocks. The integration enables marketing teams to manage content centrally in AEM while leveraging it in MoEngage campaigns for personalized customer engagement.

Use Cases

Integrating Adobe Experience Manager with MoEngage helps you with the following use cases:
  • Campaign Content Management: Marketing teams create promotional content in AEM. When published, it automatically syncs to MoEngage Content Blocks, making it immediately available for email campaigns, push notifications, and in-app messages.
  • Personalized Experience Delivery: Create localized Experience Fragments in AEM with personalization tokens. These automatically sync with MoEngage, utilizing converted tokens to enable personalized campaigns based on user attributes.
  • Dynamic Content Updates: Update product descriptions, offers, or messaging in AEM. Changes automatically propagate to all active MoEngage campaigns using those Content Blocks, ensuring consistency across channels.
  • Multi-Channel Content Reuse: Author content once in AEM and use it across multiple MoEngage campaigns (email, push, in-app) without duplication or manual copying.

Integration

Approach

Implement a custom integration within AEM and use custom workflows to an API call to MoEngage Content Block APIs whenever relevant content is created, updated, or published. This ensures MoEngage has access to the latest AEM content.

Flow diagram

We will develop a custom AEM Workflow Process Step that connects to the MoEngage APIs.

Supported Content Types

The following table outlines the content types that can be synced from AEM to MoEngage:

Supported Actions

PrerequisitesBefore you begin, ensure you have the following requirements:
  • Active Adobe Experience Manager instance (AEM 6.5 or AEM as a Cloud Service).
  • AEM Author and Publish environments configured.
  • Maven project setup with appropriate permissions to deploy OSGi bundles.
  • MoEngage workspace with API access enabled.
  • MoEngage Workspace ID (API Key) and Data API Secret.
  • Java development environment with AEM SDK.
  • Understanding of AEM Workflows and OSGi services.

Step 1: Get your MoEngage API Credentials

To find your credentials, perform the following steps:
  1. On the left navigation menu in the MoEngage UI, click Settings > Account > APIs.
  2. On the APIs page, copy the following credentials:
    1. Workspace ID (earlier app id): You can use this as API Key (MOE-APPKEY header).
    2. Campaign API Secret: You can use this as Basic Authentication.
  3. Find your data center code from your dashboard’s URL. For more information, refer Data Centers in MoEngage.

Step 2: Update Maven Project Dependencies

To update Maven project dependencies, perform the following steps:
  1. Add the org.json library to your AEM project’s core/pom.xml file to ensure proper JSON payload construction.
  2. Locate the <dependencies> section in core/pom.xml.
  3. Add the following dependency:
Why org.json? The org.json library automatically escapes special characters (quotes, newlines) in HTML content, preventing JSON payload errors. Manual string concatenation can break the MoEngage API call if content contains these characters.

Step 3: Setting up the Custom Workflow

You need to create an OSGi service that handles content sync to MoEngage. The service implements the WorkflowProcess interface and registers as a workflow step. You can refer to the sample shared below or create one of your own.

Sample production ready implementation

This implementation covers the full lifecycle management:
  • Handles Experience Fragments with variations.
  • Supports Content Fragments and DAM Assets.
  • Debug mode with webhook support for testing.
  • Improved HTML cleaning and link externalization.
You can just copy this code and add it to a file path - core/src/main/java/com/[your-company]/integration/workflow/MoEngageContentSyncStep.java
MoEngageContentSyncStep.java
Troubleshooting:If deployment errors occur, check the error.log file in crx-quickstart/logs/ for detailed error messages.

Step 4: Build and Deploy the OSGi Bundle

After you add the code, to build and deploy your AEM project, perform the following steps:
  1. Navigate to your project root directory.
  2. Run the Maven build command:
  3. Verify the bundle is active in the OSGi Console at http://<aem-author>:4502/system/console/bundles.
  4. Search for your bundle name and confirm status is Active.

Step 5: Create The Workflow Models

Create the following workflow models to handle publish operation:

Workflow 1: Publish Workflow (ACTIVE Status)

To publish workflow (ACTIVE status), perform the following steps:
  1. Navigate to Tools > Workflow > Models in AEM Author.
  2. Click Create > Create Model.
  3. Enter workflow details:
    1. Title: MoEngage Content Sync
    2. Name: moengage-content-sync
  4. Open the workflow for editing, delete the default step.
  5. Drag the Process Step from the sidebar to the workflow canvas.
  6. Double-click the Process Step to configure it.
  7. In the Process dropdown, select MoEngage Content Sync.
  8. In the Arguments field, enter:
  9. Click OK to save.
  10. Click Sync to save the workflow model.

Configuration Parameters

Step 6: Configure Workflow Launchers

Navigate to Tools → Workflow → Launchers and create 6 launchers to handle publish, unpublish, and delete operations:

Experience Fragments Launchers

DAM Assets Launchers

For all launchers:
  • Set Run Modes: author
  • Set Enabled: true
  • Replace [your-site] with your actual site path

Step 7: Test the Integration

Enable Debug Mode (Recommended)
For initial testing, add debug parameters to workflow arguments:
Get a free webhook URL from webhook.site to inspect payloads in real-time.
  1. Navigate to the Experience Fragment or Content Fragment in AEM Author.
  2. Select the page information icon.
  3. Click Start Workflow.
  4. Select MoEngage Content Sync Workflow.
  5. Click Start.

Personalization Token Mapping

The workflow automatically converts AEM personalization tokens to MoEngage format:

Additional Resources

Support and Customization

Support:For assistance with deployment, custom content extraction logic, troubleshooting, or advanced configurations, contact MoEngage Integration Support or your Customer Success Manager.