Create coupon on loyalty tier upgrade Closed beta
This tutorial describes how to trigger effects when a customer reaches a new loyalty tier.
To do so, we'll use the Trigger Rule Engine: Tier upgrade integration in the Integration Hub to run a rule after tier upgrades.
As an example, we'll create a welcome coupon for customers who reach the Gold tier. When a tier upgrade happens, the integration sends a custom event to the Rule Engine, which then evaluates it and creates a coupon for the new Gold tier member.
For more use cases, see the overview of the integration.
Prerequisites
- You are an admin user.
- You have created an Application and a campaign.
- You have set up a profile-based loyalty program with at least two tiers, so that a customer can change tier. For this tutorial, we assume the loyalty program has a Silver and a Gold tier.
- The loyalty program is connected to your Application.
Configure your Application
Create an Integration API key
In your Application, create an Integration API key.
Ensure the Application is connected to your loyalty program.
Create custom attributes
Create three custom attributes to store the previous and current tier values, as well as the customer profile ID:
| Property | Attribute 1 | Attribute 2 | Attribute 3 |
|---|---|---|---|
| Entity | Event | Event | Event |
| Event type | LoyaltyTierUpgrade | LoyaltyTierUpgrade | LoyaltyTierUpgrade |
| Type | String | String | String |
| API name | OldTier | CurrentTier | ProfileIntegrationID |
For a list of the available event attributes and their types, see the overview of the integration.
This automatically creates a custom
event named
LoyaltyTierUpgrade that contains the three attributes.
Create a rule
In your campaign, create a rule to issue a welcome coupon when a customer reaches the Gold tier:
| What | Name | Properties |
|---|---|---|
| Conditions | Check for event types and custom event values |
|
| Effects | Create coupon code |
|
Configure the integration
Create an instance
Create an instance in the Integration Hub:
- Open > Integrations > Generic integrations.
- Open the Trigger Rule Engine: Tier upgrade integration and click Configure. If instances already exist, click Add instance.
- On the Initial Configuration page, enter a descriptive name for the instance, for
example,
Trigger tier upgrade event, and click Next.
Configure the connection
On the Connection page, enter the following:
| Field | Value |
|---|---|
| Base URL | The base URL of your Talon.One deployment. Example: mycompany.europe-west1.talon.one |
| API key | The Integration API key you created. |
Select a loyalty program
On the Loyalty Program page, select the loyalty program connected to your Application.
The integration will only process tier upgrades from this loyalty program.
Configure event mapping
On the Event Configuration page:
-
Click Add to Field Mappings.
-
In Field Mappings, map the tier upgrade notification fields to the custom attributes you created. In this example, the source and target field names are the same, but you still must add them explicitly:
Source field name Target field name OldTierOldTierCurrentTierCurrentTierProfileIntegrationIDProfileIntegrationID -
In API Event Type, enter
LoyaltyTierUpgrade. This must match the event type you assigned to the custom attributes.
Test the setup
Let's test our setup by triggering a loyalty tier change for a customer:
- Manually add loyalty points to a customer's profile. Add enough points to trigger a tier change from Silver to Gold.
- In your Application, open the Events page.
- In the list of events, find the
LoyaltyTierUpgradeevent for the customer whose tier you just upgraded. If you don't see the event, wait a few minutes and refresh the page. - In the Effects column, click 1 triggered.
The Triggered effects drawer opens, showing the coupon code created for the customer,
for example, WELCOMEGOLD-Y88B.