Personalize Content Using Content APIs

Overview

Content APIs allow you to create personalized campaigns by fetching data dynamically at the time of sending the campaign based on recommendations, coupons, or other Personalization APIs. Such targeted, relevant, and timely communication has much better engagement and conversion rates than generic email campaigns.

library_add_check

Prerequisites

Before starting your journey with content APIs, you must add a content API to MoEngage. For more information, refer to Content APIs.

After adding the API to MoEngage, you can create campaigns using any existing content templates with API calls embedded in the content. These campaigns can contain placeholders for different SKUs, with the required formatting, segmentation, and triggering schedules.

Channels That Support Personalization Using Content APIs

You can add Content APIs to the campaigns sent using the following channels:

Channel Supports Personalization?

Push (Mobile and Web Push)

Yes

Email

Yes
SMS Yes
In-app Messaging Yes
On-Site Messaging Yes
Cards No
WhatsApp Yes
Connectors Yes
Facebook Audience No
Google Ads Audience No
info

Information

You can personalize Content APIs using user attributes. Personalization is also possible for event attributes when the event is linked to the same campaign.

Create a Personalized Campaign

In step 2, "Content," of the campaign creation, use the ContentApi variable to access all the configured Content API sources. You can use the Content API by directly calling the ContentApi variable in the code or by choosing the required content API from the Personalization editor:

    1. Type @ in the content editor of your campaign.
    2. On the Personalization dialog box, click the Data personalization tab.
    3. In the Select attribute list, click the Content API created.
      Email_ContentAPI.png
    4. Click Done. The Content API gets added to the message.
      For example, the Content API dynamically fetches the recommended products for a given user ID in the following screenshot. You can use this feature to engage users with product recommendations and nudge them toward making a purchase. The value parameter can be a dynamic parameter (type @ to add a user attribute to be passed to the Content API) or a static parameter that can be keyed in the value section.
      ContentAPI_RecoPdt_EmailPersonlizationUI.png
      When added, this appears as follows in the Template editor:

      ContentAPI_added_in_Email_Editor.png
    5. Click Preview to see how the user will see it in their inbox.

Example

You may have a cart data source with the following JSON:

JSON
{
 "date": "March 10, 2016",
 "items": [
   {
     "name": "belt",
     "image": "http://mydomain.com/images/1001.jpg",
     "price": 11
   }, {
     "name": "shoes",
     "image": "http://mydomain.com/images/1002.jpg",
     "price": 12
   }, {
     "name": "hat",
     "image": "http://mydomain.com/images/1003.jpg",
     "price": 10
   }
 ]
}

In the content creation, use the following code:

Code
{% for cart_item in ContentApi.cart().items %}
 <div>
   <h2>{{ cart_item.name }}: ${{ cart_item.price|round(2) }}</h2>
   <img src="{{ cart_item.image }}" />
 </div>
{% endfor %}

Was this article helpful?
0 out of 0 found this helpful

How can we improve this article?