Event & Conversion Tracking
Track conversions and revenue with NextLinks' flexible event system. Works with internal offers, partner postbacks, and custom integrations.
Fast Integration
3 methods: server-side, JS pixel, or image pixel
Revenue Tracking
Support for CPC, CPA, and RevShare payouts
Partner Ready
Built-in support for affiliate postbacks
Build Your Postback URL
Find this in Attribution → Events
From the URL parameter when user lands
Understanding Events
How Event Tracking Works
- User clicks your NextLink and lands on your page with a
click_idparameter - You capture and store this
click_id - When a conversion happens, you send a postback to NextLinks with the
click_id - NextLinks records the event and attributes it to the original click
Key Parameters
| Parameter | Required | Description |
|---|---|---|
| pbk | Yes* | Your postback key (identifies the event type) |
| click_id | Yes* | Unique identifier from the click |
| value | No** | Conversion value (for revenue tracking) |
| metadata | No | JSON object for custom data |
* At least one required. ** Required for RevShare payout type.
Payout Types
When you create an Offer with an event config, you choose how revenue is calculated:
Cost Per Click
Revenue is earned when a user clicks the offer link. No postback needed.
Cost Per Action
Revenue is earned when a conversion is recorded (via postback). Fixed amount per conversion.
Postback required. value parameter optional (payout is fixed).
Revenue Share
Revenue is a percentage of the sale amount. You must pass the sale value in the postback.
Postback required. value parameter required (sale amount).
Internal vs External Offers
Internal Offers
For your own products/ad units. Conversion fires automatically when user clicks.
- • No postback setup needed
- • Best for CPC campaigns
- • Instant attribution
When to use:
Your own landing pages, internal ad units, direct links
External Offers
For partner/affiliate offers. Conversion fires when partner sends postback.
- • Partner integration required
- • Best for CPA/RevShare
- • Accurate conversion tracking
When to use:
Affiliate offers, partner programs, external advertisers
How External Offers Work
When you create an external offer, NextLinks automatically appends click_id and pbk to the destination URL. The partner uses these to send conversion data back.
Integration Methods
Method 1: Server-Side Postback
Most reliable method. Fire an HTTP request from your server when a conversion occurs.
// When a conversion happens on your server
async function trackConversion(clickId, value, metadata) {
try {
const response = await fetch('https://nextlinks.ai/api/event', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
pbk: 'YOUR_POSTBACK_KEY',
click_id: clickId,
value: value,
metadata: metadata
})
});
return await response.json();
} catch (error) {
console.error('Conversion tracking failed:', error);
}
}
// Usage
await trackConversion('abc123-def456-ghi789', 49.99, { order_id: 'ORD-123' });Method 2: JavaScript Pixel
Add to your thank you/confirmation page. Automatically reads click_id and pbk from URL parameters.
<!-- Basic (for CPA - no value needed) -->
<script src="https://nextlinks.ai/pixel.js"></script>
<!-- With value (for RevShare) -->
<script src="https://nextlinks.ai/pixel.js" data-value="49.99"></script>
<!-- With custom postback key -->
<script src="https://nextlinks.ai/pixel.js" data-pbk="YOUR_KEY" data-value="49.99"></script>Note: The pixel uses multiple delivery methods (fetch, image, beacon) for reliability. May be blocked by ad blockers.
Method 3: Image Pixel
Simplest implementation. Returns a 1x1 transparent GIF.
<!-- Replace CLICK_ID dynamically with the actual click_id from URL -->
<img src="https://nextlinks.ai/api/event?pbk=YOUR_POSTBACK_KEY&click_id=abc123-def456-ghi789&value=49.99"
width="1" height="1" style="display:none" />Capturing the Click ID
When users land on your page from a NextLink, the URL contains a click_id parameter. Here's how to capture it:
// Get click_id from URL
const params = new URLSearchParams(window.location.search);
const clickId = params.get('click_id');
// Store in cookie for later (e.g., on checkout)
if (clickId) {
document.cookie = `nl_click_id=${clickId}; max-age=2592000; path=/`;
}
// Retrieve later
function getClickId() {
const params = new URLSearchParams(window.location.search);
const urlClickId = params.get('click_id');
if (urlClickId) return urlClickId;
const cookies = document.cookie.split(';');
const clickIdCookie = cookies.find(c => c.trim().startsWith('nl_click_id='));
return clickIdCookie ? clickIdCookie.split('=')[1] : null;
}API Response
// 200 OK
{
"success": true,
"eventId": 12345,
"clickStatus": "found" // or "pending" if click still processing
}Testing Your Integration
- Create a test NextLink pointing to your landing page
- Click the link to generate a real
click_id - Note the
click_idfrom your landing page URL - Use the simulator in Attribution → Simulate to test
- Check Attribution → Events → Logs for results