Segment Integration module

Edition

Incubator (services)

Git

Git

Latest

1.0

Compatible with Magnolia 6.2.

The Segment Integration module enables Magnolia Authors to create multichannel personalized experiences based on insights from Segment without ever leaving the Magnolia UI. This module leverages the personlization feature in Magnolia. You should be familiar with Personalization before continuing.

Security considerations

You should use the Segment Integration module to encapsulate rest-based calls of a frontend to third party systems through Magnolia. This way passwords and other critical security information are hidden the browser.

You can also leverage this module for other CDPs.

This module is at the INCUBATOR level.

Benefits

Omnichannel personalization

As a Customer Data Platform, Segment allows you to track and understand your customers' needs at every stage in their journey, on any channel or application (whether Magnolia rendered or headless frontend application). This way, you get a 360 degree view of your customers and can use the insights to connect the journey with personalized content from Magnolia.

One unified editorial workflow

Marketers and other content editors get to comfortably deliver personalized content for different audiences straight from the Magnolia UI, without switching between tools. They can create content variants, including entire pages, and choose the right audience for each variant, including based on Segment data. All in one unified workflow in Magnolia.

Low code implementation

Developers get to implement the integration using a low code approach. Adding Segment scripts to any frontend application, defining and sending tracking events to Segment, fetching the data for personalization - all can be done using simple YAML configuration.

Installing with Maven

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

<dependency>
  <groupId>info.magnolia.cdp</groupId>
  <artifactId>magnolia-customer-data-platform-common</artifactId>
  <version>1.0</version>
</dependency>

Configuration

The configuration consists of two parts:

  • A Rest Endpoint that can be called from the desired frontend

  • A Rest Client that controls the call to the third party system.

Rest Endpoint

<light-module-name>/restEndpoints/<restEndpointName>
class: info.magnolia.cdp.common.rest.service.ConfiguredRestProxyEndpointDefinition
implementationClass: info.magnolia.cdp.common.rest.service.RestProxyEndpoint
restClientName: <restClientName>
restCallName: <restClientMethodName>

Rest Client

<light-module-name>/restClients/<restClientName>
baseUrl: <URL to the external Service>
securitySchemes:
  b1:
    $type: basic
    username: <username to the third party system>
    password: ''
restCalls:
  <restClientMethodName>:
    method: get
    path: /<path of the method>/${idProperty}
    securityScheme: b1

Frontend call example

await fetch('/.rest/<restClientName>', {
    method: 'POST', (1)
    headers: { 'Content-Type': 'application/json' },
    body: `{"idProperty":"${idProperty}"}`
});
1 The Rest Client can be both GET and POST, but the Rest Endpoint must be called with POST.

Usage

Here, we provide some basic examples of using the Segment Integration module.

Create a content variant

The variant can be configured completely differently in terms of copy or images.

  1. On your desired page, click the Component you want to edit.

    add component variant

  2. Click Edit component and change something to create a component variant.

    add component variant dialog

Example

In the example here, we are choosing a different image for the particular component.

For more on components in Magnolia, see Editing pages.

Choose the variant audience

  1. Select the variant you just created, and click Choose audience.

    choose audience segment

  2. Define your audience and select the traits. Here, you’ll see traits that are taken directly from Segment. Cool, huh?

    choose audience segment traits

Changelog

The Changelog covers all updates related to this module.

Version Notes

1.0

Initial release of the module.

Feedback

Incubators

×

Location

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

You are currently perusing through the Segment Integration module docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules