Step 1: Install the javascript SDK

Paste the following code on every page of your website


!function(e,t,n,a,c,s,r){e[a]||((c=e[a]=function(){c.process?c.process.apply(c,arguments):c.queue.push(arguments)}).queue=[],c.t=+new Date,(s=t.createElement(n)).async=1,s.src=""+864e5*Math.ceil(new Date/864e5),(r=t.getElementsByTagName(n)[0]).parentNode.insertBefore(s,r))}(window,document,"script","metr"),metr("init","YOUR_API_KEY"),metr("integration","stripe");


Make sure to replace YOUR_API_KEY with your actual Metricks API Key.

Step 2: Add Metricks to your signup form

Add data-metricks to the form that gets submitted when you create a new Stripe Customer (signup form, upgrade form, etc).

This will pass along an affiliate parameter to your server when the form is submitted.

<form action="/signup" method="post" data-metricks>

<!-- your signup form here -->


Step 3: Add affiliate to Stripe Customer Metadata

The affiliate parameter will be submitted with the rest of the form data in Step 2.

Add affiliate to Stripe’s Customer’s Metadata. Whenever that customer pays an invoice, a commission will be paid to the affiliate who generated the referral.