How do I trigger rewards with a custom event?
In this setup, a referral is only counted towards the reward if the custom event is triggered. For example, in a single-sided reward that requires 20 referrals with a "purchase" custom event, if the user has earned 30 referrals already the reward will not trigger until at least 20 of those referred people makes the purchase.
To properly record a custom event, all you need is the email address of the referred user who did the action and the name of the action. You then have different ways to tell Prefinery that the event occurred to trigger the reward if the conditions are sufficient.
Setting the Reward's Award Event to Custom Event
In the Reward Editor when creating a new reward in your account, set the Award Event to Custom Event and specify the name of the custom event.
For example, if you want to reward someone only after they make a purchase on your site, you could input
purchase as your event name.
You can reuse the same event name when setting up multiple rewards and all will be triggered when the person completes the event.
Recording the Event
a. Record event via our REST API
The API Rewards#trigger endpoint can be used to tell us that a person has performed the custom event. Simply send the person's email address and the name of the custom event to Prefinery to get it recorded and trigger the rewards if all conditions are met (i.e. there's enough referrals with corresponding custom events).
prefinery('triggerRewards', data, callback) method.
c. Record event via Zapier
You can also use Zapier in order to tell us that a person has performed the custom event. Simply use the Trigger Rewards action event in your zap action step to send us the person's email address and the name of the custom event.
Delivering the Reward
If all conditions are met to trigger the reward, it can then be delivered to the user. For more information on delivering the reward, please refer to: How do I deliver rewards?
Example Reward Setups
While a referral credit is given to the referrer when a friend signs up through their unique referral link, that referral does not count towards the reward goal until the friend also performs the action (custom event).
A. Single-Sided Reward (reward your users when they refer their friends)
Say a single-sided gift card reward is configured to be earned after 5 referrals and those 5 friends need to perform the action “purchase”.
If the user refers 10 friends, no reward is earned until at least 5 of them perform the action.
B. Double-Sided Reward (reward both the user and their friend when a referral happens)
This is an example of a double-sided reward where the referring user needs to refer 5 friends and each friend needs to perform the action “purchase” for the referrer to receive a $50 Coupon, and each referred friend gets a $10 Coupon.
Here's a scenario:
John needs to refer 5 friends. John refers the first friend, Maria. Maria performs the event “purchase”. You'd then call the Trigger Rewards method described in the Recording the Event section earlier with Maria's email address (e.g. “firstname.lastname@example.org”) and custom event "purchase". The returned value is an array of 1 reward (that Maria gets a $10 coupon).
Time goes by and now John has already referred 4 friends, each of which has purchased. Now, he’s referring the 5th friend, Sarah. When Sarah performs the event “purchase” two rewards will be issued ($50 to John and $10 to Sarah). In this event, when you call the Trigger Rewards method with “email@example.com” did “purchase”, the return value is an array of 2 rewards ($50 to John and $10 to Sarah).
For a complete walkthrough, see our guide How to Create a Referral Program like AirBnB.