Documentation
Everything you need to integrate and use LeadFnF
Getting Started
Quick Start Guide
Create Your Account
Sign up at https://leadfnf.com/register and complete your profile setup.
Get Your API Keys
Navigate to Settings > API Keys and generate your production and sandbox keys.
Add Tracking Code
Install our JavaScript tracking snippet on your website (shown below).
Connect Your Platform
Integrate with Stripe, Shopify, WooCommerce, or use our API.
Start Tracking
Test your integration and start inviting affiliates!
Installation
Add this JavaScript snippet to your website, just before the closing </body>
tag:
Important
Replace YOUR_API_KEY
with your actual API key from the dashboard.
Testing Your Integration
Use these test parameters to verify your tracking is working:
https://yoursite.com/?ref=TEST123
Open your browser's developer console and look for LeadFnF tracking events.
Clicks should appear in your dashboard within seconds.
Integration Guides
Stripe Integration
Connect your Stripe account to automatically track payments and attribute them to affiliates.
Code Example:
Shopify Integration
Install our Shopify app to automatically track orders from affiliate referrals.
WooCommerce
Free WordPress plugin for seamless WooCommerce integration.
Custom API
Build your own integration using our RESTful API.
API Reference
Base URL
https://api.affiliatehub.com/v1
Authentication
All API requests require authentication using your API key in the header:
Authorization: Bearer YOUR_API_KEY
Track Click
POST/clicks
Record an affiliate click when a user clicks on an affiliate link.
Request Body:
Response:
Track Conversion
POST/conversions
Record a conversion when a referred user makes a purchase.
Request Body:
Response:
Get Affiliate
GET/affiliates/:code
Retrieve information about a specific affiliate.
Response:
List Affiliates
GET/affiliates?page=1&limit=20
Get a paginated list of all affiliates.
Query Parameters:
Code Examples
JavaScript
PHP
Python
cURL
Webhooks
What are Webhooks?
Webhooks allow LeadFnF to send real-time notifications to your server when specific events occur. Instead of polling our API for changes, we'll send an HTTP POST request to your configured endpoint whenever an event happens.
Setup
- 1 Go to Settings > Webhooks in your dashboard
- 2 Click "Add Webhook" and enter your endpoint URL
- 3 Select which events you want to receive
- 4 Save and test your webhook
Available Events
click.created
Triggered when a new click is tracked
conversion.created
Triggered when a conversion is recorded
affiliate.approved
Triggered when an affiliate is approved
affiliate.suspended
Triggered when an affiliate is suspended
commission.paid
Triggered when a commission is paid out
Webhook Payload Example
Webhook Signature Verification
Verify webhook signatures to ensure requests are coming from LeadFnF:
Link Tracking Guide
Affiliate Link Structure
Affiliate links use a simple query parameter structure:
You can also use custom parameters:
Cookie Duration
When a user clicks an affiliate link, we set a cookie that persists for your configured duration (default: 30 days). Any conversion within this period is attributed to the affiliate.
Cookie Behavior:
- First-party cookies for better tracking
- Configurable expiration (7, 30, 60, 90 days)
- Last-click attribution model
- Secure and HttpOnly flags for security
UTM Parameters
Add UTM parameters to track campaign performance:
Deep Linking
Affiliates can link to any page on your site:
Commission Structure Setup
Percentage-Based
Pay a percentage of each sale to affiliates.
Fixed Amount
Pay a flat amount per conversion.
Tiered Structure
Reward top performers with higher rates.
Commission Rules
Product-Specific Commissions
Set different commission rates for specific products or categories:
Recurring Commissions
For subscription-based businesses, set up recurring commission payments:
- Lifetime commissions on all subscription payments
- First month only commissions
- First X months commissions (e.g., 3, 6, 12 months)
Troubleshooting
Clicks Not Being Tracked
- Tracking code not properly installed
- Ad blockers preventing tracking script
- Incorrect API key in tracking code
- JavaScript errors on page
- Verify tracking code is in
<body>
section - Check browser console for errors
- Test with ad blockers disabled
- Verify API key matches dashboard
Conversions Not Attributing Correctly
- Cookie not being set properly
- User clearing cookies between click and conversion
- Conversion tracking code missing
- Wrong affiliate code in conversion call
- Ensure tracking code is on all pages
- Verify cookie domain settings
- Test with browser console monitoring
- Check conversion API call parameters
API Authentication Errors
- Invalid or expired API key
- Using sandbox key in production
- Missing Authorization header
- Incorrect header format
- Regenerate API key in dashboard
- Verify using correct environment key
- Check header format:
Bearer YOUR_KEY
- Test with cURL example from docs
Webhooks Not Receiving Events
- Endpoint URL not accessible
- Webhook endpoint returning errors
- SSL certificate issues
- Firewall blocking requests
- Verify endpoint is publicly accessible
- Check webhook logs in dashboard
- Ensure endpoint returns 200 status
- Test with webhook testing tools
Still Need Help?
Can't find what you're looking for? Our support team is here to help!
Ready to Get Started?
Start building your affiliate program today with LeadFnF.
Start Free TrialNo credit card required • 14-day free trial • Cancel anytime