To see which plans include the Klaviyo integration please see our pricing page. If Klaviyo isn't listed on your integrations page within LoyaltyLion and you would like it, please contact support@loyaltylion.com
Please note that using one Klaviyo account with more than one LoyaltyLion program is not supported.
Awarding Points when a customer subscribes to SMS
If you are currently using Klaviyo's SMS functionality, you can use a Webhook flow to tell LoyaltyLion when a customer subscribes, and give that customer some points, like you would for email subscriptions.
The customer will need to be part of your loyalty program first, before they can get the points. If they sign up for SMS prior to joining the program, they will not be able to re-trigger the rule, as they cannot subscribe twice. The points can be given manually, or the rule triggered manually, for that customer.
Create your custom rule, by going to Manage, then Rules, and then Create New Rule.
Click on the Custom Rule option. This will open the Custom Rule screen, and you will want to remember some of these options:
Identifier - this will be referenced later in the flow. For this example, we will use the identifier 'klaviyo_sms'.
Points - This will be up to you, but in this example, we will use 100 points.
Approval method - as this will be triggered via the webhook, set it to immediate.
Limit - the maximum limit for a custom rule is once per year, which is what we will be using.
Your Details section should look something like this:
For the Display section, you will want to give your Rule a title, and add in a notification. For the description, we want to push customers to sign up for SMS. You can do this by embedding a link into the description, which you can get from Klaviyo.
When setting up your SMS sign up page in Klaviyo, ensure that you are capturing both the mobile number and the email address of your customer. This ensures they are signing up to SMS notifications, and so that the points can also be delivered to the customer.
To add a link to the description, you can use this code, adding in the URL for the sign up page where prompted:
<a href="[ENTER URL HERE]" style="color: blue; text-decoration-line: underline;" target="_blank" rel="noopener noreferrer">Enter description text here</style></a>
You can then save your Rule and move to Klaviyo.
In Klaviyo, go to Flows, and Create New Flow. When prompted, click that you want to Create your Own.
In the Flow creator, go to Your Metrics on the right hand side, select Klaviyo metrics, and then Subscribed to SMS Marketing, as the trigger.
When the trigger has been selected, add a Profile Filter. Choose Properties about someone, and then the LoyaltyLion property 'enroll_date', ensure that Type is 'Text' and then change to 'is set', like so.
This ensures the Flow only starts when someone is confirmed to also be in the loyalty program, avoiding any failed sends.
You can then add a Webhook Action under the trigger. This will open up a panel on the right-hand side, which will need the following settings:
Destination URL - This is the API we want to connect to. For this rule, it will be https://api.loyaltylion.com/v2/activities
You will need to add two headers, each with a Key and Value.
For the Authorization header, you'll first need to create an API Key in LoyaltyLion.
AuthorizationKey:
Authorization
Value:
Bearer YOUR_API_KEY
(Replace
YOUR_API_KEY
with the actual key you created in LoyaltyLion)Example Value:
Bearer pat_123456789
Content-TypeKey:
Content-Type
Value:
application/json
Your headers should then look like the below :
For the JSON body, you will need to add the following:
Name - this is the identifier of the Custom Rule that you created before, for this example, it is 'klaviyo_sms'.
Customer ID - this is the ID of your customer in your ecommerce platform. To add this, we are going to add the property sent by LoyaltyLion to Klaviyo, called loyaltylion_merchant_id. This can be added to the body via the variable {{ person.loyaltylion_merchant_id }}.
Customer Email - this is the email of the customer, and can be added through the variable {{person.email}}.
Your payload should now look like this:
{
"name": "klaviyo_sms",
"customer_id": "{{ person.loyaltylion_merchant_id }}",
"customer_email": "{{ person.email }}"
}
You can now save, and publish this Flow. You can track the status of this Flow within Klaviyo, and the number of times the rule has been triggered from within LoyaltyLion.