Conversions Not Tracking
If conversions aren’t appearing in your AffiliateBase dashboard, this guide helps identify and fix the issue.
Quick Checklist
Before diving deep, verify these basics:
- Tracking script is installed and working
- Affiliate link was clicked before purchase
-
client_reference_idpassed to Stripe - Stripe webhook is connected
- Purchase actually completed (not abandoned)
Diagnosis Steps
Step 1: Verify Referral Was Captured
Before checkout, in browser console:
console.log(window.affiliatebase_referral);
Expected: A referral ID string like "abc123-def456"
Problem: If undefined, referral wasn’t captured
Step 2: Check Stripe Session
In your Stripe Dashboard, find the checkout session:
- Go to Payments → Find the payment
- Click to view details
- Look for
client_reference_idfield
Expected: Contains the referral ID Problem: If empty/missing, referral wasn’t passed to Stripe
Step 3: Verify Webhook Delivery
In Stripe Dashboard:
- Go to Developers → Webhooks
- Find the AffiliateBase endpoint
- Check recent deliveries
- Look for
invoice.paidevents
Expected: 200 response status Problem: Failed deliveries indicate webhook issues
Step 4: Check AffiliateBase Dashboard
- Go to Dashboard or Referrals
- Filter by recent time period
- Look for the conversion
Expected: Conversion appears with affiliate attribution Problem: Missing conversion or wrong attribution
Common Issues & Solutions
Issue: Referral Not Captured (Step 1 Failed)
Causes:
- Affiliate link wasn’t clicked
- Script not installed on entry page
- Testing on localhost (doesn’t work)
- Ad blocker interference
Solutions:
- Ensure script on all pages (not just checkout)
- Test with affiliate link:
yoursite.com?via=affiliate-token - Verify script loads before checking referral
- Test on deployed site, not localhost
Issue: Referral Not Passed to Stripe (Step 2 Failed)
Causes:
client_reference_idnot included in checkout- Referral accessed before script loaded
- Code error in checkout flow
Solutions:
Check your checkout code:
// Correct approach
const referralId = window.affiliatebase_referral;
const session = await stripe.checkout.sessions.create({
// ... other options
client_reference_id: referralId || undefined, // Pass the referral
});
Common mistakes:
// Wrong: Not accessing the right variable
client_reference_id: window.referral, // ❌
// Wrong: Accessing before script loads
// Script is async, may not be ready
const referral = window.affiliatebase_referral; // Could be undefined if too early
// Correct: Check script is ready
window._abq = window._abq || [];
window._abq.push(() => {
const referral = window.affiliatebase_referral; // ✓ Script is ready
});
Issue: Webhook Not Delivering (Step 3 Failed)
Causes:
- Webhook endpoint not configured
- Endpoint URL changed
- Server not responding
- Firewall blocking requests
Solutions:
-
Re-verify Stripe connection:
- Go to AffiliateBase Settings → General
- Reconnect Stripe if needed
-
Check webhook endpoint in Stripe:
- Developers → Webhooks
- Verify endpoint URL is correct
- Check it’s receiving
invoice.paidevents
-
Test webhook delivery:
- Find a failed delivery
- Click “Resend” to retry
- Check response
-
Verify server is accessible:
- Endpoint must be publicly accessible
- No authentication blocking webhook
Issue: Conversion Not Appearing (Step 4 Failed)
Causes:
- Webhook delivered but processing failed
- Attribution window expired
- Self-referral blocked
- Affiliate disabled
Solutions:
-
Check attribution timing:
- When was affiliate link clicked?
- When was purchase made?
- Was it within attribution window?
-
Verify affiliate status:
- Is affiliate active (not disabled)?
- Is affiliate in correct campaign?
-
Check self-referral settings:
- If customer email = affiliate email, might be blocked
- Review Settings → Affiliate → Self-referral detection
-
Review referral status:
- Find the referral in dashboard
- Check its status (active vs frozen)
Testing Conversions
Full Test Flow
-
Create test affiliate (or use existing)
-
Click test affiliate link:
https://yoursite.com?via=affiliate-token -
Verify referral captured:
console.log(window.affiliatebase_referral); // Should have value -
Complete test checkout:
- Use Stripe test card:
4242 4242 4242 4242 - Any future expiry, any CVC
- Use Stripe test card:
-
Check in AffiliateBase:
- Wait 1-2 minutes
- Look for conversion in dashboard
- Verify attributed to correct affiliate
Debug Mode
Add console logging to your checkout:
console.log('Starting checkout...');
console.log('Referral ID:', window.affiliatebase_referral);
const session = await stripe.checkout.sessions.create({
// options...
client_reference_id: window.affiliatebase_referral,
});
console.log('Session created:', session.id);
console.log('client_reference_id:', session.client_reference_id);
Stripe Webhook Debugging
Check Webhook Events
- Go to Stripe Dashboard → Developers → Webhooks
- Click your AffiliateBase endpoint
- View “Webhook attempts”
Understanding Response Codes
| Code | Meaning | Action |
|---|---|---|
| 200 | Success | Working correctly |
| 400 | Bad request | Check payload format |
| 401 | Unauthorized | Re-verify signature |
| 404 | Not found | Check endpoint URL |
| 500 | Server error | Check AffiliateBase status |
Resending Failed Webhooks
- Find the failed event
- Click “Resend”
- Monitor for success
- If still failing, contact support
Payment Links Troubleshooting
For Stripe Payment Links:
- Verify script is on the page containing the Payment Link
- Check link modification:
- Inspect the link element
- Should have
client_reference_idappended
If not being modified:
- Ensure referral exists (
window.affiliatebase_referral) - Check for JavaScript errors
- Verify script loaded before link renders
Promo Code Conversions
If using promo codes instead of links:
-
Check promo code passed correctly:
metadata: { promo_code: 'AFFILIATE-CODE' } -
Verify code matches affiliate:
- Code must be assigned to an affiliate
- Exact match required (case-sensitive)
-
Check priority:
- Promo codes take priority over link attribution
- If both exist, promo code wins
Still Not Working?
Information to Gather
Before contacting support:
- Test purchase Stripe payment ID
- Expected affiliate attribution
- Whether referral was captured (console output)
- Whether
client_reference_idwas passed (Stripe session) - Webhook delivery status
- Screenshots of relevant dashboards
Contact Support
Email support@affiliatebase.com with:
- All gathered information
- Steps you’ve already tried
- Your organization ID
Prevention
Monitoring Recommendations
- Test regularly: Run test conversions periodically
- Monitor webhooks: Set up Stripe webhook alerts
- Check dashboard: Review conversions daily
- Alert on failures: Configure notifications
Best Practices
- Always pass
client_reference_idto Stripe - Test after any code changes
- Use promo codes as backup attribution
- Keep tracking script on all pages