Build easy-to-use apps
Loyalty Points is an up-and-coming loyalty tracking software. They've worked for years to perfect their loyalty tracking infrastructure, and now they want to turn their focus to communicating with customers.
A great solution here is to build an integration with Klaviyo. That way, customers can connect their Klaviyo account with Loyalty Points in just a few clicks and maximize the power of both platforms.
As part of this integration, Loyalty Points wants to automatically send customers a message when they hit a new loyalty tier in order to inform them of new perks and benefits.
Integrate Klaviyo with Loyalty Points
Check out this video to see how Loyalty Points planned and set up their integration.
Design an integration with the end goal in mind
Starting from their desired end result, Loyalty Points worked backward to determine how to structure and implement their new integration. Read through the dropdowns below to learn more about how they approached this task.
Identify the end goal and requirements
Ultimately, Loyalty Points wants their integration to send a message when customers move tiers. Each tier has different perks, so Loyalty Points wants to send different emails to different tiers, and they want to include the number of points each customer has and the number required to move to the next tier.
There are two pieces of required data here:
- Message
- Events when customers move up and down tiers
What data do you have access to?
In their own software, Loyalty Points maintains the number of points each customer has as well as the name of the tier they are in. They also keep track of historical loyalty, so you can see each customer's points and tier status over time.
How should the required data be structured?
Message
In Klaviyo, messages can be part of campaigns or flows. Klaviyo supports omnichannel messaging, so Loyalty Points can opt to send email, SMS and/or push notifications.
For this use case, Loyalty Points wants to send messages in response to an event that occurs, i.e., a customer moving up or down a loyalty tier. They decide email is the best medium for this messaging, since they don't want to interrupt the end user and they want to include longer form content. Based on this, they decide the ideal messaging strategy is a metric-triggered flow that contains an email.
Event
Loyalty Points decides to create 2 events:
- Moved up a loyalty tier
- Moved down a loyalty tier
Each event will trigger a flow that sends an email to the customer informing them of their new tier.
They can use a series of trigger splits within each flow to send different messages to the different tiers:
Trigger splits look at the event that triggered the flow, in this case, Moved up a loyalty tier.
Event data needs to be top-level in order to be used in a trigger filter, so Loyalty Points needs to structure their events so that New Tier Name is top-level and not nested.
Loyalty Points also wants to display the number of points each customer has in the body of the emails. When they send an event, they can also update a custom profile property containing the number of loyalty points each customer has. Then, they can use Django to display this number in the body of the email.
Identify the correct endpoint(s)
The only data that needs to be sent into Klaviyo are the events that fire when customers move up and down loyalty tiers. They can use the Create Event endpoint to create both of these events and update profile properties. Check out this example Moved up a loyalty tier event in Postman: