Stripe Sessions API
Integrate Push Lap Growth to your website using stripe sessions API
This guide provides a detailed walkthrough of integrating Stripe with the Push Lap Growth affiliate tracking system using the Session API. This method ensures accurate tracking of purchases and referrals.
Step 1: Tracking Clicks
Insert the following script in your website's <head>
tag to start tracking clicks:
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: Connect Stripe
To proceed, connect your Stripe account by going to Dashboard → Integrations → Connect payment processor → Stripe. (Please complete the whole stripe connection flow to have your affiliate program connected to your stripe account)
Step 3: Send Affiliate Data to Stripe
You need to send the Push Lap Affiliate ID to Stripe using one of the following methods:
1. client_reference_id
parameter.
2. Stripe session metadata with the key pushLapAffiliateId
.
When the script from Step 1 is installed globally, you will have access to: window.affiliateId
on your frontend only
This ID must be sent to your backend when creating a new checkout session.
Using client_reference_id
const stripeSession = await stripe.checkout.sessions.create({
success_url: "https://your-website.com/success",
cancel_url: "https://your-website.com/cancel",
client_reference_id: window.affiliateId, // Retrieved from frontend
mode: "subscription",
line_items: [
{
price: "PRICE_ID",
quantity: 1,
},
]
});
Using Metadata
const stripeSession = await stripe.checkout.sessions.create({
success_url: "https://your-website.com/success",
cancel_url: "https://your-website.com/cancel",
mode: "subscription",
metadata: {
pushLapAffiliateId: window.affiliateId // Retrieved from frontend
},
line_items: [
{
price: "PRICE_ID",
quantity: 1,
},
]
});
Summary
By following these steps, you can successfully integrate Stripe with Push Lap Growth for accurate affiliate tracking.