Javascript Integration
Use this method to use frontend javascript to track signups and sales
This guide provides a detailed walkthrough of using Javascript to track signups and sales (for example you could execute the create sale function when a user purchases something on the confirmation page).
Step 1: Tracking Clicks
Insert the following script in your website's <head>
tag to start tracking (on every page):
Normal Method
<script
src="https://pushlapgrowth.com/affiliate-tracker.js"
data-affiliate
data-program-id="YOUR_AFFILIATE_PROGRAM_ID"
async>
</script>
Using Google Tag Manager
<script>
var pushLap = document.createElement('script');
pushLap.src = "https://pushlapgrowth.com/affiliate-tracker.js";
pushLap.setAttribute('data-affiliate', '');
pushLap.setAttribute('data-program-id', 'YOUR_AFFILIATE_PROGRAM_ID');
document.head.appendChild(pushLap);
</script>
Step 2: Tracking sign-ups (referrals)
Call this function when a user signs up or enters their email to be able to track it as a referral (it will automatically be attached to the affiliate - if there's one who referred them).
window.createPushLapEmail('<EMAIL>', '<NAME>');
Please note that email is required, but name is optional. And both variables are your responsibility to provide.
Step 3: Tracking sales
Call this function when a user purchases something to be able to track it as a sale (it will automatically be attached to the affiliate - if there's one who referred them or if their sign up has already been tracked before).
window.createPushLapSale({
userId: '<EXTERNAL_USER_ID>',
amount: <AMOUNT>,
name: '<NAME>',
email: '<EMAIL>'
});
Please note that only name and email are required. And both variables are your responsibility to provide.
Summary
By following these steps, you can successfully integrate Stripe with Push Lap Growth for accurate affiliate tracking.