Loyalty Lion

Loyalty Partner

Overview

LoyaltyLion is a customer loyalty and engagement platform designed for e-commerce businesses. It helps brands to incentivize customer behavior and personalize user engagement through data-driven loyalty programs.

By integrating LoyaltyLion with CleverTap, you can:

  • Send order and event data from CleverTap to LoyaltyLion using Webhooks
  • Fetch user-specific reward data from LoyaltyLion into CleverTap using Linked Content and personalize campaigns

Prerequisites for Integration

Ensure you have the following:

  • LoyaltyLion API credentials (available in your LoyaltyLion dashboard).
  • Access to your CleverTap dashboard with permissions to configure webhooks and campaigns.

Integrate LoyaltyLion with CleverTap

To integrate LoyaltyLion with CleverTap, perform the following major steps:

  1. Create a Webhook in CleverTap
  2. Configure Webhook Campaign in CleverTap
  3. Personalize Campaigns Using LoyaltyLion Rewards

Create a Webhook in CleverTap

Create a webhook to push event and order data from CleverTap to LoyaltyLion. This webhook lets CleverTap transmit relevant customer activity data (for example, purchases, order totals, shipping) directly to LoyaltyLion in real time.To do so, perform the following steps:

  1. Go to Settings > Channels > Webhook from the CleverTap dashboard.
  2. Click + Create Webhook and fill in the details:
FieldValue
NameLoyaltyLion Orders Webhook
MethodPOST
Endpointhttps://api.loyaltylion.com/v2/orders
HeadersContent-Type: application/json
AuthorizationBearer

You will find the API key in your Loyalty Lion Dashboard in Settings

LoyaltyLion Dashboard

LoyaltyLion Dashboard

  1. Click Save.

Configure Webhook Campaign in CleverTap

To push transactional data (like orders) to LoyaltyLion:

  1. Go to Campaigns > + Campaign > Webhook.
  2. Select the Webhook configured in Create a Webhook in CleverTap
  3. In the What section, under the Webhook Content section, select the Content Format as JSON and click the Custom body option.
  4. Paste the following payload:
{
  "merchant_id": "1212",
  "merchant_number": "12",
  "customer_id": {{ Profile.Identity | default: "0" }},
  "customer_email": "{{ Profile.Email | default: "[email protected]" }}",
  "total": "{{ Profile.Total | default: "0" }}",
  "total_shipping": "{{ Profile.Total_Shipping | default: "0" }}",
  "payment_status": "{{ Profile.Payment_Status | default: "Fail" }}",
  "date": "{{ Profile.order_date | default: "0" }}",
  "discount_codes": [
    {
      "code": "{{ Profile.code-used | default: "0" }}",
      "amount": "{{ Profile.amount | default: "0" }}"
    }
  ]
}

Type {, {{, or @ to view available personalization options.

  1. Click Preview and Test the campaign to check if the data appears correctly in the LoyaltyLion dashboard.
Verify the data on LoyaltyLion

Verify the data on LoyaltyLion

  1. If everything works as intended, click Publish.

For more information, refer to the Loyalty Lion API documentation.

Personalize Campaigns Using LoyaltyLion Rewards

Use Linked Content to fetch real-time rewards from LoyaltyLion and show them in campaigns. To display personalized creatives using dynamic URLs, follow these steps:

  1. Configure the Linked Content API in CleverTap.
  2. Create a Personalized Campaign Using Linked Content.

Configure Linked Content API in CleverTap

To display the personalized rewards in CleverTap campaigns, you must configure Linked Content. To do so, follow these steps:

  1. Go to Settings > Setup > Linked Content from the CleverTap dashboard.
  2. Click + Linked Content.
  3. Provide a relevant name for the Linked Content, set the HTTP method to GET, and use the following endpoint as the destination URL:
    <https://api.loyaltylion.com/v2/customers/{{cid}}/available_rewards>
    

In this URL, cid represents the customer ID used to retrieve the user's available rewards. Ensure this parameter is marked as mandatory.

Configure Linked Content in CleverTap

Configure Linked Content in CleverTap

  1. In the Headers, add this below key-value pair:
    • Authorization: Bearer <Loyalty Lion API Key>
  2. Test the Linked Content to ensure it returns the expected output.
Test the Linked Content

Test the Linked Content

  1. Click Save to finalize the Linked Content configuration.

Once your Linked Content is configured, you can use it in any messaging channel.

Create Personalized Campaign Using Linked Content

With LoyaltyLion connected to CleverTap via Linked Content, you can now deliver personalized rewards through your campaigns. To do so, perform the following steps:

  1. Go to Campaigns from the CleverTap dashboard and click + Campaign.

  2. Select Push Notification from the Messaging Channels list.

  3. Configure all the campaign settings and then go to the What section:

    1. Click Personalization.

    2. Select the Linked Content configured under Configure Linked Content API in CleverTap and click Apply.

      Personalization

      Personalization

  4. Set the cid parameter to Custom and assign the value {{ Profile.c-id | default: "0" }}. This dynamically fetches the customer ID cid from the user profile when the campaign is delivered.

Create Personalized Message Using Linked Content

Create Personalized Message Using Linked Content

This configuration ensures that the correct variant is fetched based on the userโ€™s customer ID and displayed in the campaign.

  1. Use the following Linked Content Liquid tag to extract the reward title from the LoyaltyLion Get Reward APIโ€™s JSON response:
{{ Linked["Loyaltly Lion get rewards"].json.rewards[0].title | default: "NULL" }}
  1. Configure the campaign's Title and Message using the retrieved reward title. For example:
Set the Title and Message

Set the Title and Message

  1. Click Preview & Test to verify if the campaign pushes the default values you configured.
  2. Clickย Publishย to launch the campaign. Verify if everything works as intended. Users will receive a push notification such as the one below.
Push Notifications

Push Notifications

By integrating LoyaltyLion with CleverTap, you can deliver real-time personalized visuals at scale across the following channels: Push Notifications, Email, In-App Messages, or Web Popups, LoyaltyLion empowers you to deliver highly relevant, personalized messaging at scale.