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
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.
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.
Watch it
- Video
- Click through
Steps
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.
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.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.
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.
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.Related
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.