---
title: Lab 3: Service Contract Renewal
slug: zeiss-hol/lab-3-service-contract-renewal
docTags: 
createdAt: 2026-01-26T12:12:08.088Z
---

:::hint{type="info"}
**Focus area**
Adobe Journey Optimizer

**Features**
Orchestrated Campaign

Ad Hoc Targeting

Data driven email activation

Multiple messages per profile

**Difficulty**
Easy
:::

## Use case description

As a Marketer, I want to inform customers about their expiring service contracts and provide an option to contact us for renewal: automated notifications will be sent 30 days before expiration, followed by a reminder 10 days before expiration, and a final call on the contract end date.

## Resources

**Relational data model**
Data engineers have designed a relational data model and populated it with sample data.

There are 3 main entities: **Account**, **Device&#x20;**&#x61;nd **Service Contract**

Each entity has been described with a **Relational&#x20;**&#x73;chema.

The relationships between entities have been defined with these cardinalities:&#x20;

- 1 account is linked to 0..N device(s)
- 1 device is linked to a 0..N service\_contract
- 1 service\_contract is linked to 0..N device

The Entity Relational Diagram is visible in `Data management > Schemas > Relationships `

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/4zy-kpXOzj5ruC-CUxqwe_image.png)



**Email template**

A Web Agency has provided an email template named **\[Example] Contract Expiration Alert Message**  available in the Content template library in `Content Management > Content template > All template` folder.

## Solution Design

**Orchestrated Campaign** is the solution that let you create easily an audience by manipulating **multiple entities** like contract and recipient. This process let you discover, manipulate, filter the data and calculate aggregate in an **iterative way** (start/resume/stop/restart the flow).

**Orchestrated Campaign&#x20;**&#x69;s the only solution that let you deliver one email per contract, that means that a profile with multiple expiring contracts will receive multiple emails.

The following steps will describe:

- how to create segments of expiring contracts
- how to deliver one email per contract
- how to transform a segment in an audience

:::hint{type="warning"}
This solution has been designed to illustrate **capabilities&#x20;**&#x6F;f the product.The implementation details could change in real life conditions.
:::

## Step 1 - Ad Hoc Targeting

:::hint{type="info"}
**Goal**
Filter the contracts

Create 3 segments:

- Contracts that will expire in 30 days
- Contracts that will expire in 10 days
- Contracts that will expire today

**Highlight**

Build audience, Distribution of values, Enrichment, Split
:::

One way to do it is to follow these steps:

1. Create a new Orchestrated Campaign
2. Build an audience of contracts
3. Calculate the number of days before the expiration
4. Split the records in 3 segments

### Create a new Orchestrated Campaign

- In the menu on the left side, under **Campaigns**, click on **Orchestration**&#x20;
- Click on the **Create campaign** button
- Select **Orchestration - Marketing** and click o&#x6E;**&#x20;Confirm**
- Set the name to `[your name] Service Contract Renewal`
- Click on **Save**

### Filter contracts

- Click on the + icon to display the list of activities

::Image[]{src="https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/QtzlDnx-sphSpdzmBEiV6_image.png" size="34" width="300" height="333" position="center" showCaption="false"}

- Select the **Build audience** activity
- Set the Targeting dimension to **service\_contract**
- Click on **Create audience** button
- Click on **Add condition**
- Select **service\_contract\_name**, click on the **...&#x20;**&#x62;utton and click on **Distribution of values**

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/BgpIOyGyFg6DqceeN2iRg_image.png)

- Close and just set the filter condition **to service\_contract\_name is not empty**
- Click on **Calculate&#x20;**&#x74;o get a count of records
- Click on **Confirm**
- Click on **Start&#x20;**&#x74;o start queries in a simulation mode

::Image[]{src="https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/QPlWFfWzUJDjK4_y0MD2Q_image.png" size="72" width="609" height="156" position="center" showCaption="false"}

- Click on the **Result&#x20;**&#x62;ox in the green transition link and click on **Preview results** button to see the results

### Calculate the number of days before the expiration

- Click on the + icon to display the list of activities&#x20;
- Select **Enrichment**
- Click on the **+ Add enrichment** data button
- Click on **Edit expression** button
- Click on **Fx &#x20;**(Helper functions) icon and set this expression

:::Paragraph{indent="1"}
`DaysDiff([target/@service_contract_end], GetDate())`
:::

- Click on **Confirm** button
- Click on **Resume&#x20;**&#x62;utton to let the engine execute the Enrichment activity

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/U8dxJYYVd_kxY_tjkPl5P_image.png)

- Click on the **Result&#x20;**&#x62;ox in the green transition link and click on **Preview results** button to see the results

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/E0B35-UeN6p4CiOQD62B3_image.png)

### Split the records in 3 segments

- Click on the + icon to display the list of activities&#x20;
- Select the **Split&#x20;**&#x61;ctivity
- Define 3 segments and filter with the calculated field
  - Contracts that will expire in 30 days
  - Contracts that will expire in 10 days
  - Contracts that will expire today
- Enable the **Generate complement&#x20;**&#x6F;ption
- Click on **Resume&#x20;**&#x62;utton
- Depending on the day, the results below will change

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/IHJe7k-crrZMqsN232qq1_image.png)

:::hint{type="warning"}
To illustrate **capabilities&#x20;**&#x6F;f the product, different conditions have to be set up in order to get records in the segments.
:::

- As an exercise, change the filters to get more records in the segments and enable the overlapping option; for instance:
  - 1st segment:&#x20;

:::BlockQuote
`(DaysDiff(service_contract_end, GetDate()) equal to 30) 
OR 
 (service_contract_id included in (S-CT-900, S-CT-901, S-CT-910, S-CT-911))`
:::

:::Paragraph{listStyleType="disc" indent="2"}
2nd segment:&#x20;
:::

:::BlockQuote
`(DaysDiff(service_contract_end, GetDate()) equal to 10) 
OR 
 (service_contract_id included in (S-CT-001, S-CT-002, S-CT-900, S-CT-901))`
:::

:::Paragraph{listStyleType="disc" indent="2"}
3rd segment:&#x20;
:::

:::BlockQuote
`(DaysDiff(service_contract_end, GetDate()) equal to 0) 
OR
 (service_contract_id included in (S-CT-001, S-CT-002, S-CT-003, S-CT-900, S-CT-901, S-CT-910, S-CT-911))`
:::

:::Paragraph{listStyleType="disc" indent="2"}
Check the box **Enable overlapping of output populations**
:::

:::Paragraph{listStyleType="disc" listStart="2" indent="2"}
Click on **Resume** button to get these results
:::

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/1jZ7mPbNEDmotvtXOo-TS_image.png)

## Step 2 - Send one email per contract

:::hint{type="info"}
**Goal**
Send messages to recipients, not contracts

Send 1 email per contract - 1 recipient can receive multiple messages

Add personalization data in the email like **many devices** per contract

**Highlight**

Enrichment of the target with a collection of device, Change dimension, Email personalization
:::

### Enrichment of the target

- On the first segment, click on the + icon to add an **Enrichment&#x20;**&#x61;ctivity
- Add the fields that will be used to personalize the email
  - service\_contract\_end
  - service\_contract\_name
  - all the devices covered by the contract
- It's possible to add these devices in the target by collecting many records this way
  - Select the path  `Targeting dimension > service_contract_device > device > device_description`

::Image[]{src="https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/d3BY6I6Wg5hgEMsImQA82_image.png" size="64" width="464" height="438" position="center" showCaption="false"}

:::Paragraph{listStyleType="disc" indent="2"}
Keep the option **Collect data** and set the length to 5
:::

::Image[]{src="https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/RCqIzpow8UU9W9r122lu2_image.png" size="44" width="233" height="474" position="center" showCaption="false"}

- Click on **Resume&#x20;**&#x61;nd get a preview of the results

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/snWfAUYzujM9GklyrQTdT_image.png)

- 5 new columns have been added in the target; these 5 columns match 5 devices

:::hint{type="success"}
**The target contains both email addresses and personalization data.**

Email messages will be delivered to all the recipients that are in this list.

Email messages will be personnalized with all the data that have been added in this list.
:::

### Change the targeting dimension

:::hint{type="warning"}
**Notes about "Change dimension"**

The **Change dimension** activity allows you to change the targeting dimension as you are building an audience. It shifts the axis depending on the data template and the input dimension. For example, you can switch from the contracts dimension to the clients dimension.

This step is **required&#x20;**&#x74;o prepare the target in order to let the product deliver messages (email, push, SMS). The engineers are working to improve this process by maybe removing this step.
:::

- Click on the + icon to add an **Change dimension** activity
- Select Recipient as the new target dimension

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/J8JbeQRkcDEkzegxNgbIf_image.png)

- Click on the **Resume&#x20;**&#x62;utton and get a preview of the results

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/7geL892SZlsI0_cyyVKS7_image.png)

:::hint{type="success"}
**The new targeting dimension is now Recipient**

The first column of the target is the **crmId&#x20;**&#x66;ield that has been tagged as the identity field in the schema, used to make a reconciliation with profiles in the Real-time Profile Store.
:::

### Personalize an email message

- Click on the + icon to add an **Email** activity
- Click on **Edit email** button
- In the **Actions** tab, select the surface named **config-email-marketing-service\_contract**

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/5DZw3PeOhHDYTtZCWi_yh_image.png)

:::hint{type="info"}
**Channel configuration&#x20;**

The `config-email-marketing-service_contract` channel has been set to deliver one email per contract. This design disable a deduplication on the recipient email address.

It's possible to configure this channel to deliver the message by using the email address set in the contract.

::Image[]{src="https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/fmwVv419gvcj8rSCWIt7O_image.png" size="86" width="799" height="699" position="center" showCaption="false"}
:::

- Click on **Edit content** button
- Click on **Content template** button, then **Apply content template**
- Select the template named `[Example] Contract Expiration Alert Message`
- Click on **Confirm&#x20;**&#x62;utton to apply the template
- Edit the subject line to replace \[FIRST\_NAME] by a personalization field

::Image[]{src="https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/KoaA9ftC32da1GxsJfW4W_image.png" size="72" width="554" height="89" position="center" showCaption="false"}

- Edit the subject line to replace \[FIRST\_NAME] by a personalization field located in `Target attributes > recipient > firstname`

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/k3qeTWPxs3h330GLa22Bm_image.png)

- Click on **Save**
- Click on **Edit email body&#x20;**&#x61;nd replace personalization fields with **Target attributes**
  - For instance, for the expiration days, the path is `Target attributes > Enrichment > DaysDiff(service_contract_end, GetDate())`



![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/V0GqK3_4ijERGLMHotMVz_image.png)

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/hbSEFD-0-aG_nMcNSgP9F_image.png)

- Repeat the personalization task with devices (1..5)

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/O_LbxqLRG6DWRH1DsqSoW_image.png)

:::hint{type="success"}
**The email is personalized with data added in the Target, attributes from the targeting dimension and attributes from the secondary dimension (service\_contract)**
:::

:::hint{type="info"}
Follow the same process to deliver a reminder email to recipients that belongs to the second segment. It's possible to Copy/Paste the activities to save time.
:::

## Step 3 - Save the Target as an Audience&#x20;

:::hint{type="info"}
**Goal**
Save the **Target&#x20;**&#x61;s an **Audience**

An Audience can be activated to CRM destination, as usual in AEP RT-CDP

**Features**

Enrichment, Deduplicate, Save audience
:::

### Enrichment of the target

- Go to the third segment and click on the + icon to add the **Enrichment&#x20;**&#x61;ctivity
  - Add the `service contract name`
  - Add the `service_contract_contact_email`
- Preview the results and look at the duplicated emails

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/HxebZH9mJebNAgQtWvJC1_image.png)

### Deduplication&#x20;

- Add the **Deduplication&#x20;**&#x61;ctivity
  - Add the attribute service\_contract\_contact\_email as a field to identify duplicates
  - Set the deduplication this way

::Image[]{src="https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/vF4HfbH358trxtZQa4xH3_image.png" size="36" width="323" height="386" position="center" showCaption="false"}

- Click on **Resume&#x20;**, preview results and check that duplicates have been removed

### Save the audience

- Add the activity **Change dimension&#x20;**&#x74;o shift from Contracts to Recipient targeting dimension
- Add a **Save audience** activity
  - Set the name to `[your name] Contract will expire today`
  - Set the profile mapping field to: `recipient - crmid`
  - Add these attributes (audience mapping): &#x20;
    - `service_contract_name`
    - `service_contract_id`

:::hint{type="info"}
The Target cannot be saved as an Audience in the simulation mode. The Orchestrated Campaign flow has to be published in order to save the audience. The next paragraph describes the audience that will be created by the Orchestrated Campaign engine.
:::

- In the menu on the left side, under **Customer**, click on **Audiences**
- Click on the audience named **Contract will expire today**

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/KV2kxv8luBKPXKUKzU8kN_image.png)

- Click on the dataset name and click on the **Preview dataset** button

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/OyzYxq4PGxhfq_FmCjoin_image.png)

### CRM destinations

- In the menu on the left side, under **Connections,** click on **Destinations**
- Go to the **Catalog&#x20;**&#x74;ab and select the CRM categories to see all the supported CRM destinations

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/vFmCu2BNDLyD4YRLSuyzX_image.png)

## Step 4 - Schedule and Publish&#x20;

:::hint{type="info"}
**Goal**
Schedule the execution of the Orchestrated Campaign flow

Publish the messages templates

Publish the exportation of data (Save audience)

**Highlight**

It's possible to execute the flow several times per day

Publish is a restricted feature and requires a permission.
:::

### Schedule

- Click on the **As soon as possible** button
- Schedule the execution of the flow several times per day

::Image[]{src="https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/IRbKM0aFc33ZWoILD3Ulp_image.png" size="80" width="722" height="743" position="center" showCaption="false"}

### Publish permission

- The **Publish&#x20;**&#x62;utton is restricted to the operators who have the **Publish Orchestrated Campaigns&#x20;**&#x70;ermission&#x20;

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/K_9j3BvijV9fpJVfHJIOn_image.png)

:::hint{type="success"}
**Congratulations** on successfully completing the exercise!&#x20;

This lab focussed on these topics:

- Multi-Entity & Relational Data Modelling/Processing
- Orchestrated Campaign Logic
- Audience Creation & Ad-hoc Analysis
- Data-Driven Email Activation & Templates
:::

