Conversions Not Tracking

Troubleshoot why conversions aren't appearing in your dashboard

Table of Contents

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_id passed 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:

  1. Go to Payments → Find the payment
  2. Click to view details
  3. Look for client_reference_id field

Expected: Contains the referral ID Problem: If empty/missing, referral wasn’t passed to Stripe

Step 3: Verify Webhook Delivery

In Stripe Dashboard:

  1. Go to DevelopersWebhooks
  2. Find the AffiliateBase endpoint
  3. Check recent deliveries
  4. Look for invoice.paid events

Expected: 200 response status Problem: Failed deliveries indicate webhook issues

Step 4: Check AffiliateBase Dashboard

  1. Go to Dashboard or Referrals
  2. Filter by recent time period
  3. 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:

  1. Ensure script on all pages (not just checkout)
  2. Test with affiliate link: yoursite.com?via=affiliate-token
  3. Verify script loads before checking referral
  4. Test on deployed site, not localhost

Issue: Referral Not Passed to Stripe (Step 2 Failed)

Causes:

  • client_reference_id not 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:

  1. Re-verify Stripe connection:

    • Go to AffiliateBase Settings → General
    • Reconnect Stripe if needed
  2. Check webhook endpoint in Stripe:

    • Developers → Webhooks
    • Verify endpoint URL is correct
    • Check it’s receiving invoice.paid events
  3. Test webhook delivery:

    • Find a failed delivery
    • Click “Resend” to retry
    • Check response
  4. 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:

  1. Check attribution timing:

    • When was affiliate link clicked?
    • When was purchase made?
    • Was it within attribution window?
  2. Verify affiliate status:

    • Is affiliate active (not disabled)?
    • Is affiliate in correct campaign?
  3. Check self-referral settings:

    • If customer email = affiliate email, might be blocked
    • Review Settings → Affiliate → Self-referral detection
  4. Review referral status:

    • Find the referral in dashboard
    • Check its status (active vs frozen)

Testing Conversions

Full Test Flow

  1. Create test affiliate (or use existing)

  2. Click test affiliate link:

    https://yoursite.com?via=affiliate-token
  3. Verify referral captured:

    console.log(window.affiliatebase_referral); // Should have value
  4. Complete test checkout:

    • Use Stripe test card: 4242 4242 4242 4242
    • Any future expiry, any CVC
  5. 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

  1. Go to Stripe Dashboard → Developers → Webhooks
  2. Click your AffiliateBase endpoint
  3. View “Webhook attempts”

Understanding Response Codes

CodeMeaningAction
200SuccessWorking correctly
400Bad requestCheck payload format
401UnauthorizedRe-verify signature
404Not foundCheck endpoint URL
500Server errorCheck AffiliateBase status

Resending Failed Webhooks

  1. Find the failed event
  2. Click “Resend”
  3. Monitor for success
  4. If still failing, contact support

For Stripe Payment Links:

  1. Verify script is on the page containing the Payment Link
  2. Check link modification:
    • Inspect the link element
    • Should have client_reference_id appended

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:

  1. Check promo code passed correctly:

    metadata: {
      promo_code: 'AFFILIATE-CODE'
    }
  2. Verify code matches affiliate:

    • Code must be assigned to an affiliate
    • Exact match required (case-sensitive)
  3. Check priority:

    • Promo codes take priority over link attribution
    • If both exist, promo code wins

Still Not Working?

Information to Gather

Before contacting support:

  1. Test purchase Stripe payment ID
  2. Expected affiliate attribution
  3. Whether referral was captured (console output)
  4. Whether client_reference_id was passed (Stripe session)
  5. Webhook delivery status
  6. 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

  1. Test regularly: Run test conversions periodically
  2. Monitor webhooks: Set up Stripe webhook alerts
  3. Check dashboard: Review conversions daily
  4. Alert on failures: Configure notifications

Best Practices

  1. Always pass client_reference_id to Stripe
  2. Test after any code changes
  3. Use promo codes as backup attribution
  4. Keep tracking script on all pages