Affy.pro | Paddle Integration
Paddle × Affy.pro

Track Affiliate Conversions with Paddle

Automatic conversion tracking for Paddle payments. Set up in 3 lines of code with webhook support for subscriptions, refunds, and one-time payments.

How It Works

1

Configure Webhook

Add webhook URL to Paddle Dashboard

2

Add Tracking Code

Include affy.js on your site

3

Enrich Checkout

Pass clickID to Paddle checkout

Track Conversions

Automatic webhook processing

Works with Paddle Billing

This integration supports Paddle Billing (the modern Paddle platform). Tracks one-time purchases, subscriptions, and refunds automatically via webhooks.

Quick Start Guide

1

Configure Paddle Webhook

  1. a. Go to Settings → Integration → Paddle
  2. b. Copy your unique webhook URL (e.g., https://affy.pro/api/v1/webhooks/paddle/123)
  3. c. Go to Paddle Dashboard → Developer Tools → Notifications
  4. d. Click "Add Destination" and paste your webhook URL
  5. e. Select events: transaction.completed, subscription.created, transaction.refunded
  6. f. Copy the webhook secret from Paddle and paste it back into Affy settings
  7. g. Click "Save Settings" in Affy
2

Include affy.js Tracking Script

Add this script to your website (replace with your client ID):

<!-- Add to your HTML head or body --> <script src="https://cdn.affy.pro/affy.js" data-client="YOUR_CLIENT_ID"></script>
3

Pass ClickID to Paddle Checkout

Option A: Auto-enrich (Easiest)

// Client-side with Paddle.js const config = AffyJS.enrichPaddleCheckout({ items: [{ priceId: 'pri_123', quantity: 1 }] }); // Open Paddle checkout Paddle.Checkout.open(config); // customData automatically includes: // { clickID: 'click_xxx', affiliateRef: 'AFF123' }

Option B: Manual (More control)

const customData = AffyJS.getPaddleCustomData(); Paddle.Checkout.open({ items: [{ priceId: 'pri_123', quantity: 1 }], customData: customData // Pass tracking data });

What's Supported

One-Time Payments

Track single purchases and generate commissions automatically.

Subscriptions

Track recurring subscription payments with commission on each payment.

Refunds

Automatically adjust commissions when payments are refunded.

Code Examples

Client-Side Integration (Paddle.js)

<!-- 1. Include scripts --> <script src="https://cdn.affy.pro/affy.js" data-client="123"></script> <script src="https://cdn.paddle.com/paddle/v2/paddle.js"></script> <!-- 2. Initialize Paddle --> <script> Paddle.Initialize({ token: 'your-paddle-token' }); // 3. Open checkout with tracking function buyProduct() { const config = AffyJS.enrichPaddleCheckout({ items: [ { priceId: 'pri_01234', quantity: 1 } ], customer: { email: 'customer@example.com' } }); Paddle.Checkout.open(config); } </script>

Server-Side Integration (Paddle API)

// Frontend: Get tracking data const customData = AffyJS.getPaddleCustomData(); // Returns: { clickID: 'click_xxx', affiliateRef: 'AFF123' } // Send to your backend const response = await fetch('/api/create-paddle-transaction', { method: 'POST', body: JSON.stringify({ customData, email: 'user@example.com' }) }); // Backend (Node.js example): app.post('/api/create-paddle-transaction', async (req, res) => { const { customData, email } = req.body; // Create transaction via Paddle API const transaction = await paddle.transactions.create({ items: [{ price_id: 'pri_01234', quantity: 1 }], customer_email: email, custom_data: customData // Include tracking }); res.json(transaction); });

Debugging & Testing

// Check if tracking is active console.log(AffyJS.hasPaddleTracking()); // true/false // Get tracking data console.log(AffyJS.getPaddleCustomData()); // { clickID: 'click_xxx', affiliateRef: 'AFF123' } // Get complete debug info console.log(AffyJS.getPaddleIntegrationData()); // Shows: tracking status, clickID, examples, instructions

Ready to Start Tracking?

Configure your Paddle webhook in settings and start tracking conversions in minutes.

Configure Paddle Integration