Skip to main content

How to setup your affiliate link tracking

How to install Introw affiliate tracking on your site and track conversions client-side, server-to-server, or automatically with your HubSpot forms.

Written by Wouter Moyaert

Overview

Introw affiliate tracking is quick to set up and flexible. You add a single lightweight script to your site, and from there Introw automatically detects visitors arriving through a partner link and registers the referral. When a visitor converts, you report it whichever way fits your setup: client-side with one function call, server-to-server from your backend, or easiest of all and automatically through your existing HubSpot forms, with nothing extra to wire up.

Because Introw stores attribution server-side rather than in a client-written browser cookie, tracking stays resilient to browser tracking restrictions and clean for GDPR purposes.

Install the tracking script

Add the following snippet to the <head> of every page on your site.

<!-- Introw affiliate tracking -->
<script
async
src="https://app.introw.io/affiliate.js"
data-publishable-key="pk_aff_org_y2ckxrlGTguABYgRhEIv8tIvRdPSOLiI"
></script>
<!-- End Introw affiliate tracking -->

On page load, the script reads the ref parameter from the URL (for example https://yoursite.com/?ref=zPpScHyL), calls Introw to register the referral, and stores the attribution server-side. No further action is needed for referral detection.

💡 Introw: Once the snippet is correctly installed, a green Installed status indicator will appear

Track conversions

When a visitor completes the action you want to credit, Introw records it in one of three ways: client-side, server-to-server, or automatically when you use HubSpot forms. Choose the method that matches where your conversion event fires.

Option A — Client-side tracking

Recommended when conversions happen on your website. Execute this when a visitor converts (for example, after signup):

window.introw.affiliate.track({   email: customer.email,   properties: {     "ikfexbkmwac5nko9lpk70ke8": "email"   }, });

Advanced: scope a call to this campaign (rarely needed)
Pass the campaign key as publishable Key to guard the call to this campaign: if the visitor's click belongs to another campaign, the conversion is ignored. The click cookie always decides attribution.


Option B — Server-to-server API

Best when the conversion is confirmed on your backend (for example, a closed deal or a verified payment). Send a POST request to Introw's conversion endpoint using your Introw API key scoped to affiliate:write.

Use the email (or another identifier you also pass at referral time) so Introw can match the conversion to the stored referral.

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]",
"properties": {
"ikfexbkmwac5nko9lpk70ke8": "email"
}
}'

Use the email (or another identifier you also pass at referral time) so Introw can match the conversion to the stored referral.


Option C — Automatic tracking with HubSpot forms

Best when you already capture conversions through HubSpot forms. If your site uses HubSpot forms, Introw detects form submissions automatically and attributes them to the originating partner — no tracking call or API request required and the same snippet handles both classic and v4 HubSpot forms.

Make sure the tracking script above is installed so the referral is registered, and that the form captures the visitor's email (or another identifier used at referral time) so Introw can match the submission to the stored referral.

Attribution settings

The attribution window and attribution model are defined on the affiliate campaign, not in the install:

  • Attribution window: how many days after a click a conversion still counts toward the partner.

  • Attribution model: which partner gets credit when a visitor clicks multiple affiliate links before converting (first click or last click).

Verifying your setup

To confirm tracking works end to end: visit your site using a test partner link with a ref parameter, complete a conversion, and check that the event appears against the correct partner in Introw. If referrals register but conversions don't attribute, confirm the identifier you send at conversion (such as email) matches the one captured at referral.

Did this answer your question?