Custom activities

Smile lets you reward for virtually any action your customers perform while engaging with your brand.

Here are some common actions we think are great for rewarding:

  • Newsletter subscription

  • Blog post visit

  • Watching a video

  • Filling out a survey

  • Voting on new product colors

This feature is only available to merchants on the Enterprise plan.

This guide will walk you through setting up a new custom activity so that you can start rewarding your customers for completing custom actions.

Step 1: Go to your settings

In the Smile Admin, go to Settings -> Developer Tools.

Step 2: Create a custom activity

Click "Build my first custom activity". Next, fill out the name of the activity. Once you've done that, hit "Save".

Step 3: Copy the code snippet

After hitting "Save", a code snippet will be displayed. Copy this code snippet onto your site where you want to trigger the reward.

Here is an example of using a click handler to create an activity for a logged in customer.

$('.newsletter-subscribe-button').on('click', () => {
SmileUI.smile.createActivity({
token: 'activity_Kdyxe2VNbVNePLckpiKY5apL'
}).then(() => {
console.log('Created a custom activity!');
});
});

In this code snippet, we create an activity using a combination of Smile UI and Smile.js. Note that it is also possible to create an activity using a server-to-server request.

Step 4: Start rewarding

In the Smile Admin, navigate to your points program.

From there, add a new earning rule. Select your custom activity from the list of available options.

Step 5: Test it out

Try logging in as a customer and completing the action that will trigger the activity. If you get awarded points, you're all set! 🎉