Skip to main content

What you’ll achieve

A backend that posts each affiliate conversion to the conversions API, passing the visitor’s click reference so the conversion attributes to the right partner. Because the call runs on your server, it captures conversions the browser might miss and lands them reliably on the campaign’s Conversions tab.

Before you start

1

Install the tracking snippet

The snippet sets the click cookie that links a visit to a partner. Install it first so a click reference exists to pass to the API. See Set up affiliate conversion tracking.
2

Create a secret API key with the affiliate:write scope

Server-to-server calls authenticate with a secret API key that has the affiliate:write scope. Create one in your developer settings before you start. Keep it on your server, never in client code.
3

Capture the click reference on landing

When a visitor lands from a referral link, the snippet stores a click reference in the _introw_aff cookie. Read that value and keep it with the session so you can pass it when the conversion completes.

Watch it

Steps

1

Review the API method on the Install tab

Go to Affiliate campaigns, open your campaign, select the Install tab, and expand Server-to-Server under Track conversions. It shows the exact request shape for your campaign, including the conversion form’s fields, and a link to create a secret API key with the affiliate:write scope.
Review the API method on the Install tab
2

Store the click reference

On landing, read the _introw_aff cookie the snippet sets and persist it with the user’s session or order. This reference is what ties the eventual conversion back to the partner who drove the click. Without it, the conversion cannot be attributed.
Store the click reference
3

Post the conversion when the goal completes

When the goal completes on your backend (for example, a subscription is paid), post to the conversions API. Send the stored click reference and the converter’s email; include any extra fields your conversion form expects so they flow into the created record.
curl -X POST https://api.introw.io/api/v1/affiliate/conversions \
  -H "x-api-key: $INTROW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "clickId": "<value of the _introw_aff cookie>",
    "email": "[email protected]"
  }'
await fetch("https://api.introw.io/api/v1/affiliate/conversions", {
  method: "POST",
  headers: {
    "x-api-key": process.env.INTROW_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    clickId: introwAffCookie, // value of the _introw_aff cookie
    email: "[email protected]",
  }),
});
import os, requests

requests.post(
    "https://api.introw.io/api/v1/affiliate/conversions",
    headers={"x-api-key": os.environ["INTROW_API_KEY"]},
    json={
        "clickId": introw_aff_cookie,  # value of the _introw_aff cookie
        "email": "[email protected]",
    },
)
Post the conversion when the goal completes
4

Confirm the response and the conversion

Confirm the API returns a success response, then open the campaign’s Conversions tab and check the conversion appears against the correct partner with the value you sent. A conversion only attributes if the click falls inside the campaign’s attribution window.
Confirm the response and the conversion

Verify it worked

The conversion appears on the campaign’s Conversions tab attributed to the partner whose link set the click reference, with the email and value you posted. Because the call ran server-side, it is captured even when the browser would not have fired.

Set up affiliate conversion tracking

Install the snippet and verify conversions.

Track HubSpot form conversions

Capture conversions from HubSpot forms instead.

API reference

Find the conversions endpoint.

Implementation reference

Full configuration options.