Rootabl uses a combination of client-side visitor tracking and Stripe webhook events to accurately attribute sales to affiliates.
This guide explains how attribution works under the hood, how to configure your environment, and how to test end-to-end.
1. Overview
Rootabl automatically attributes sales to affiliates when:
A visitor lands on your site through an affiliate link
The Rootabl tracking script assigns the visitor a unique visit_id
The visitor starts a purchase using Stripe Checkout or Payment Links
The visit_id is passed into the Stripe Checkout Session
Stripe notifies Rootabl via webhook when payment succeeds
Rootabl matches the visit_id → affiliate → commission rules
Sales and commissions appear in your Rootabl dashboard
Once installed, this requires no additional developer work.
2. Architecture Diagram
Visitor → Your Website → Rootabl Script → visit_id stored
↓ ↓
Affiliate link detected visit_id appended to Stripe Checkout URL
↓ ↓
Purchase begins → Stripe Checkout Session (metadata includes visit_id)
↓
Payment completed → Stripe Webhook → Rootabl → Sale + Affiliate Attribution
3. Requirements
To integrate Stripe + Rootabl, you need:
A Rootabl Business account
A Stripe account
Ability to add the Rootabl tracking script to your site
Ability to use Stripe Checkout, Payment Links, or custom checkout
No backend code is required unless you’re customizing advanced behavior.
4. Step 1: Install the Rootabl Tracking Script
Add the script to every page where visitors arrive before checkout:
<script async src="https://app.rootabl.com/rootabl.js?business=[your-business-id]"></script>
What the script does
Assigns a unique visit_id
Stores it in a first-party cookie
Reads affiliate link parameters
Automatically appends rootabl_visit_id to Stripe Checkout URLs
Example appended URL:
https://checkout.stripe.com/c/pay_123?client_reference_id=abc123
You do not need to modify your checkout links; Rootabl handles this automatically.
5. Step 2: Connect Stripe to Rootabl
Inside your Rootabl dashboard:
Business Settings → Integrations → New Payment Provider
This uses Stripe Connect OAuth to securely authorize Rootabl to:
Receive webhook events
Identify checkout sessions
Sync payment status
No API keys are exchanged directly.
6. Step 3: Configure Stripe Checkout
Rootabl works with:
Stripe Checkout Links
Stripe Payment Links
Embedded checkout buttons pointing to a Checkout URL
You do not need to add metadata manually — Rootabl automatically injects the rootabl_visit_id.
⚠️ Important: Stripe Pricing Tables Are Not Supported
Rootabl cannot track or attribute sales when using Stripe’s embedded Pricing Table component.
Stripe Pricing Tables load inside an iframe and do not expose the URL parameters or metadata Rootabl uses for attribution. Because of this:
rootabl_visit_id cannot be appended
Rootabl cannot capture the affiliate
Sales will not be attributed correctly
If you're currently using Stripe Pricing Tables, switch to:
Stripe Checkout Links
Stripe Payment Links
A button that redirects to a Checkout URL
A programmatically created Checkout Session
7. Step 5: Stripe → Rootabl Webhooks
Rootabl listens for these events from your connected Stripe account:
Stripe Event | Purpose |
checkout.session.completed | Creates a sale in Rootabl |
payment_intent.succeeded | Confirms payment success |
invoice.paid | Handles recurring payments |
charge.refunded | Reverses or adjusts commissions |
Rootabl configures its webhook endpoint automatically during Stripe Connect onboarding.
You do not need to set up your own webhook.
8. Attribution Logic
Rootabl uses the following matching sequence:
rootabl_visit_id extracted from Stripe metadata
Rootabl fetches the visit record
Visit record contains:
affiliate_id
campaign_id
UTM parameters
Commission rules applied
Sale + commission stored in Rootabl’s database
If no affiliate is associated, no commission will be attributed.
9. Testing the Integration
1. Open your site in incognito
Ensures a clean visitor session.
2. Add an affiliate parameter
Example:
3. Click to checkout
The URL should now include:
client_reference_id=XYZ123
4. Complete a Stripe test payment
Use Stripe’s test cards.
5. Check Rootabl
Go to Campaign → Sales to verify the sale.
10. Troubleshooting
Sale not appearing
Tracking script not installed
Visitor did not hit a page with the script
Using Stripe Pricing Tables (not supported)
Metadata lost in a custom checkout
Payment incomplete
Affiliate not credited
No visit_id in checkout
Visitor switched browsers or devices
Attribution window expired
Using iframe-based purchase flows (e.g., Pricing Tables)
11. Integration Limitations
Feature / Checkout Method | Supported | Notes |
Stripe Checkout Links | ✅ | Fully supported |
Stripe Payment Links | ✅ | Fully supported |
Programmatic Checkout Session | ✅ | Add metadata manually if needed |
Embedded checkout buttons linking to Checkout | ⚠️ | Supported if URL parameters preserved |
Stripe Pricing Tables | ❌ | Not supported due to iframe restrictions |
12. Summary
Once the tracking script is installed and Stripe is connected:
Attribution is automatic
No backend code needed
Metadata flows seamlessly
Sales appear in Rootabl within seconds
Commissions are calculated instantly
Just avoid Stripe Pricing Tables, and everything works out of the box.