Installing Loyalty to a Custom Platform

  • Updated

Follow this guide to set up Stamped Loyalty on a custom-built or unsupported ecommerce platform. There are two points of integration needed, and this guide walks you through each step.


In This Guide


Installing the Loyalty Launcher

The Loyalty Launcher is where customers will interact with your loyalty program. Installation is simple and requires adding a script to the header of your site.

Add the following script to your site header:

<script> 
function myInit(){ 
   StampedFn.init({ apiKey: '##publicAPIKey##', storeUrl: '##storeUrl##' });
   StampedFn.on('stamped:init:starting', function(){
   	StampedFn.initRewards({
		customerId: 123456789, // your own internal numeric ID of the customer
		customerEmail: 'johndoh@example.com',
		customerFirstName: 'John',
        	customerLastName: 'Doh',
        	customerTags: '', // your internal customer tags, separate each tag with comma e.g. Wholesale, VIP
        	totalOrders: 0, // numeric indicating customer's total orders placed with your store
        	totalSpent: 0, // numeric indicating customer's total amount spent across all orders
        	isAcceptMarketing: true, // true or false
        	authToken: '' // CustomerId + CustomerEmail (with API Private key as HMAC key)
   	});
   });
}
</script>
<script async onload="myInit()" type="text/javascript" src="https://cdn1.stamped.io/files/widget.min.js"></script>

Note: Replace all variables with your store's and customer's info. ##storeUrl## should be without 'http' or '/'

If the customer hasn't logged in yet, simply call the function with an empty object StampedFn.initRewards({});


Pushing Orders to Stamped

Once you have installed the Loyalty Launcher using the script above, you'll need to set up a flow to notify Stamped when a new order has been created or fulfilled. This allows Stamped to create orders, reward customers with their points, and update your data. You can set this up by pushing order data into Stamped using our REST API. Follow our REST API resource to configure your set-up.

 

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request