Configuring External Content

Objective

After completing this lesson, you will be able to configure External Content.

External Content Overview

External Content is a powerful tool in SAP Emarsys that enables the use of externally available data to create customized experiences. It supports the integration of external data into campaigns to achieve improved personalization.

External Content uses API calls to interact with endpoints and retrieve external data when systems send emails, web, in-app campaigns, or SMS messages with personalization tokens. The API returns JSON replies in a specific format, including data for predetermined response fields. External Content then uses values from specified reference fields as keys to select which external values to use for individual contacts.

  1. SAP Emarsys sends an API request to the client's endpoint through the External Content feature.​

  2. Then the client's API responds with the external data that SAP Emarsys uses for personalized content.

SAP Emarsys sends an API request to the client's endpoint through the External Content feature.​​ The client's API responds with the external data that the user can use to create a personalization token and insert it into campaigns.

External Content Benefits

External Content is beneficial in several scenarios:

  • Offer a solution when the RDS doesn’t support the database or when establishing connections needs intensive resources.

  • Use existing data processing logic that is essential for the business strategy alongside SAP Emarsys capabilities.

  • Offer a time-sensitive solution for linking SAP Emarsys with data sources.

Note

Visit the Help Portal for more information about:

External Content Configuration

The most important elements to understand before starting the configuration:

  
External Content ConnectionThe basic unit of External Content personalization to specify the API endpoint for the requests sent from SAP Emarsys and define the reference and response fields.
Reference fieldsSAP Emarsys uses reference fields to filter the data and to match it to contacts. External Content sends the values corresponding to these key fields in API requests.
Response fieldsResponse fields have the data that the system inserts into the messages. The response fields send back the data needed for personalization in the API response.
Personalization presetThe personalization preset refers to the External Content connection used. This configuration defines the available reference fields in the personalization token. In the preset, use every reference field for the chosen External Content connection.
Personalization tokenThe main use of the token is to specify a single response field from the response fields of an External Content connection. The system inserts this specified field into the messages at the token's location.

Before starting:

Several presets can use the same External Content connection.

Use the same preset for various tokens when applying the same reference fields. Create a separate token for each response field that needs insertion into a campaign.

  1. Setting up External Content.

  2. Setting up a preset with reference fields for personalization.

  3. Creating a token based on a preset.

This image illustrates that clients can use the same External Content connection for various presets and apply the same preset to various tokens.

The following table offers an overview of the relationship between reference fields, response fields, connections, presets, and tokens.

  
External Content ConnectionDefines:
  • Multiple Reference Fields.

  • Multiple Response Fields.

Personalization PresetUses:
  • Single External Content connection.

  • All Reference Fields from the External Content connection.

(It also defines and interprets the Reference Fields).
Personalization TokenUses:
  • Response Field.

  • Personalization Token Preset.

(It also defines: Item Index, Requirement for Setting checkbox, Fallback Text, Formatting settings).

Depending on the data used, different personalization scenarios need different numbers of reference fields and different personalization token settings.

Keep a minimal number of External Content connections for easier organization.

Preparation:

While planning External Content connections, consider these points:

  • Use connections to differentiate among different API endpoints.

  • Set up various External Content connections for the same endpoint, each with a different set of reference fields.

These steps help make the integration and configuration of External Content in SAP Emarsys effective for specific needs.

Hint

Reviewing the preparation for personalization with External Content offers a valuable understanding of the product before starting the setup and personalization process.

Set up the External Content:

Navigate to Content > External Content to configure the External Content connection and list all existing connections.

  1. Choose a descriptive name that shows the purpose of the connection. Personalization tokens use this name.

  2. Offer the API URL the External Content asks for, and check that it's valid. Example: https://customer.com/api/personal-image-generator.

  3. Select the authentication method from the following options and enter the necessary credentials:

    • Basic HTTP authentication: Specify the username and password for the client’s API.

    • OAuth2: Supports the OAuth2 client credential grant.

    • Enter these parameters:

      • URL to ask for an access token

      • Client ID

      • Client Secret

      • Scope (optional): This scope limits the data types available to SAP Emarsys

  4. Reference fields connect contact-specific data to the SAP Emarsys database. Make sure that each field includes a value from the data and specifies its use during preset creation.

  5. Indicate which JSON fields appear in the response. Use their content for personalization.

  6. Offer valid database values for testing. Click 'Test' to check the connection and debug using request and response details. When developing the API, include error messages in the response.

  7. Click 'Save' to store the connection and start a test.

External Content connection page. It shows the steps for setting up the External Content fields for connection name, API URL, Authentication method, reference fields, response fields, and test results with 'Test' and 'Save' buttons.

External Content Tokens

External Content tokens personalize messages using external data, such as data from a website. The location of the data doesn't affect the process. Store data in a database or manage it with an application, but present it to SAP Emarsys through an API in the advised format, using information from a non-SAP site.

To personalize with External Content, configure and preset the External Content connection. Click ‘Create Token’ to open a window that allows the selection of the token type for creation.

The 'Choose Personalization Capability’ window shows options for selecting the token type for creation. It includes Contact Data, Voucher, External Data, Relational Data, and External Content with a 'Technical Settings' button. The user chooses the External Content option.

Create an External Content preset:

In the Create Token page, click 'New' in the External Content preset line to open the 'Create External Content Preset' window.

  1. Assign a descriptive name to the External Content preset. It’s necessary to mention this name when choosing the preset for each token.

  2. Choose the External Content connection. Previously defined reference fields appear under 'Set Parameters.'

  3. Edit the Type and Value of available parameters. Each type influences the personalization with External Content. Choose one of the following types:

    • Contact Field: Match the reference field to an SAP Emarsys contact database field. This process aligns the correct value with the right recipient during personalization.

    • External Event: Use data from the JSON file of an External Event to define the personalization token, aiming to tailor content to specific event details.

    • Constant: Enter a value from data sources to filter. For example, if the database includes all seasons but focuses on ‘spring,’ set the constant to ‘spring.’ This method guarantees receiving the correct data.

  4. Confirm each parameter with the checkmark icon and click ‘Continue’ to finish. Then, create the External Content personalization token.

The 'Change External Content Preset' window shows how to create an External Content preset. It includes steps highlighting how to name the preset, select a connection, set parameters, choose a parameter type, and confirm changes before continuing.

Create an External Content token:

  1. Assign a descriptive token name for easy identification on the token setup page.

  2. Choose a category for the token. Tokens can belong to various categories. Create a new category. Check the 'Create Category' for more details.

  3. Choose the previously created External Content data preset. Click 'Edit' to make changes, or create a new preset if the existing one is unsuitable.

  4. Select the response field from the External Content connection within the preset selected to populate the token.

  5. Verify the SAP Emarsys Scripting Language code under the settings. Copy the code directly into the campaign's content for single use. For regular use, place it in the HTML source of the email template or the Content Block's source for web or in-app campaigns.

  6. Choose the specific item from the array using the item index.

  7. Check the box to prevent sending the message if the personalization token fails to populate.

  8. Include fallback text to show when the field value isn't available. Using fallback text and needing the field for sending can't happen simultaneously.

  9. Specify formatting details for the token.

The image shows the SAP Emarsys token creation page. Numbered labels highlight key fields: Name, Category, External Content preset, Field, Personalization token, Item index, Field content requirement, Fallback text, and Formatting type.

Note

  • Use the following format: {{ external_content.name(reference_field1, reference_field2)[index].response_field }}.

  • The list index begins at ‘0’ for the first item. ‘1’ stands for the second item, ‘2’ the third, and so forth. Use this system to select values when an API call returns several results.

  • Override the display settings at the campaign level when necessary.

  • External Content tokens easily pull response data into a campaign by using them as a form of personalization.

  • Visit this page for more information about the SAP Emarsys Scripting Language (ESL).

Lesson Summary

  • External Content overview: External Content retrieves real-time external data through API requests during message sends. It supports dynamic personalization in emails, web, in-app, and SMS campaigns.

  • Configuration and setup: This section defines External Content connections by specifying endpoints, reference fields, and response fields. Use test values to validate connections and store them for use in tokens.

  • Presets and tokens: Create presets to organize reference fields and link them to personalization tokens. Each token pulls one response field, including formatting, fallback, and validation settings.

  • Supported authentication methods: External Content supports Basic HTTP and OAuth2 authentication. Offer necessary credentials and parameters to access external APIs securely.

  • Token usage and personalization: Tokens insert external data into content using Emarsys Scripting Language. Place them directly in HTML templates or use them across various channels for consistent personalization.