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.  

Triggering a reward does not create a referral, nor does it create a reward. Triggering rewards simply records that a user did a custom action, and will evaluate whether any rewards need to be issued. The referral needs to be in place before triggering any pending rewards. 

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

You'll need to tell Prefinery that the referred person has performed the custom event so we can associate that action with the referral. To do this, you can either use our REST API, Zapier integration or JavaScript Web API. 

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). 

b. Record event via our JavaScript Web API Beta

You can use JavaScript to tell us that a person has performed the custom event. Like with the REST API this allows the sending of the person's email address and the name of the custom event to Prefinery. To learn more, see the documentation on the 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. 

Until the referrer reaches 5 referrals, the reward will not trigger for him, but will keep triggering ($10 Coupon) for each of those referred friends that makes a purchase. On the 5th referral, the reward would trigger both ($50 Coupon) for referrer and ($10 Coupon) for the referred friend that makes a purchase. 

Here's a scenario following the example above: 

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. “maria@email.com”) 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 “sarah@email.com” did “purchase”, the return value is an array of 2 rewards ($50 to John and $10 to Sarah). 

Can a referred friend trigger the reward again if they perform the custom event (purchase)? No. Prefinery rewards are primarily referral-triggered (besides the custom event when it becomes a requirement). When the referred friend triggered the reward for themselves, it required two things: a new referral and a performed custom event. When the same referred friend performs the custom event again, it will no longer trigger the reward since one of the requirements is missing: a new referral. This is because a referral only happens once between the referrer and the referred friend for the referral relationship to be established. 


For a complete walkthrough, see our guide How to Create a Referral Program like AirBnB.

Still need help? How can we help? How can we help?