Only available on Enterprise plans.
Smile.io lets you reward for virtually any action your customers do while engaging with your brand. Our platform supports the ability to reward for a variety of standard actions, but sometimes you want to reward for additional custom actions that may be specific to your brand. Good news is, if your system is able to detect when the action occurs, then Smile can reward for it!
Here are some common custom actions we think are great candidates for rewarding:
Newsletter subscription
Blog post visit
Watching a video
Filling out a survey
Voting on new product ideas
After creating a new type of custom activity, you need to setup your system to notify us when the activity has occurred. You can do this via Javascript on the frontend, or server-side using an API call.
Using Javascript Copy the provided Javascript snippet into your frontend. We recommend inserting it as a callback (i.e. something that runs after submitting your newsletter subscription form or once the desired action has been completed). To create activities via Javascript, you'll need to make sure that the Javascript SDK setting in Smile Admin is enabled.
Be careful when using Javascript to send custom activities!
Since Javascript source code is available in the web browser, users of your website can manipulate data via the Developer Console to send you multiple activities, or even activities that they have not actually performed. To eliminate this concern, consider adding rate limits to your earning rules (so that you only reward once for a given type of activity) or sending custom activities via a backend API call instead.
Using a backend API call You can use the Activities endpoint to notify Smile that a given activity has been performed by a customer. To do so, you'll need to extract the activity's token/type from the provided code sample:
The token/type will always start with activity_
, followed by a series of letters and numbers. You will then use this value along with the customer's Smile ID to send an API call to the activities endpoint which lets us know the activity has taken place.
POST https://api.sweettooth.io/v1/activities{"activity": {"customer_id": 1,"token": "activity_dDPUD2R6I9czhXcm037w6SWj"}}
By default, Smile does not issue rewards for new custom activities, so you need to create a new earning rule that specifies how you would like to reward. When selecting what activity you would like to reward for, scroll to the bottom and choose the custom activity you just created.
Once selected, you'll simply configure the earning rule as you would any other, and it will become available as part of your normal program!
If you're notifying us that the activity has occurred using Javascript on the frontend, it's a good idea to make sure your earning rule has a rate limit. This helps prevent abuse and spam from users playing around in their web browser's developer console.
That's it, you're done! Smile will now automatically issue rewards any time a customer performs the activity you've just setup.