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

  1. User clicks your NextLink and lands on your page with a click_id parameter
  2. You capture and store this click_id
  3. When a conversion happens, you send a postback to NextLinks with the click_id
  4. NextLinks records the event and attributes it to the original click

Key Parameters

ParameterRequiredDescription
pbkYes*Your postback key (identifies the event type)
click_idYes*Unique identifier from the click
valueNo**Conversion value (for revenue tracking)
metadataNoJSON 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:

CPC

Cost Per Click

Revenue is earned when a user clicks the offer link. No postback needed.

Example: $0.50 per click × 1,000 clicks = $500 revenue
CPA

Cost Per Action

Revenue is earned when a conversion is recorded (via postback). Fixed amount per conversion.

Example: $25 per signup × 40 signups = $1,000 revenue

Postback required. value parameter optional (payout is fixed).

RevShare

Revenue Share

Revenue is a percentage of the sale amount. You must pass the sale value in the postback.

Example: 30% of sales × $5,000 total sales = $1,500 revenue

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

Recommended

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

  1. Create a test NextLink pointing to your landing page
  2. Click the link to generate a real click_id
  3. Note the click_id from your landing page URL
  4. Use the simulator in Attribution → Simulate to test
  5. Check Attribution → Events → Logs for results