Display point awards for purchases on external ecommerce sites

2020-10-28 09:29:00.0
Incentives Developers

Display point awards for purchases on external ecommerce sites

In order to integrate the functionality of displaying the points that can be awarded when making a purchase, you will need to make use of Kademi’s rewards-lib library. This library contains the function kpoints() that allows to show these points on an external site.

First we will need to add this library to the page:


Here is an example of a page where you want to show the points:


Product 1


Product 2


For this example, we will be using the series called 'ecom-series' that has a Point Allocation Source named 'points-for-a-claim', which will assign 100 points for every product sold:

When calling this function we will need the following parameters:

  • pointsUrl: A url to the function.
  • series: The name of the series which will capture the sales and award points.
  • pointsSelector: The css selector for the element where the points will be displayed.
  • participantsId: Id of the user.


Here is a sample call to the function for the previous page:

   pointsUrl : "http://mysite.com/points-calc",
   series : "ecom-sales",
   pointsSelector : ".num-points",
   participantId : "joe-bloggs"

The result should be something like this: