Planning to use sub IDs, postbacks or ad tracking? You still need the tracking script for clicks. See Using sub IDs, postbacks or ad tracking with the API below.
Tracking Flow
1. Store and retrieve link token (Referral ID):
When a visitor arrives through a referral link (e.g., https://yourdomain.com?fpr=joe13, wherefpr is the affiliate’s Referral ID parameter and joe13 is the value), retrieve the referral link token (Referral ID) from the referral link, store it in the browser’s localStorage or as cookie for later use.
I. Store referral link token implementation
II. Retrieve referral ID/token
2. Lead/Referral tracking
When a visitor signs up or fills an opt-in form, convert them to a referral by using the track/signup endpoint.Using sub IDs, postbacks or ad tracking with the API
If you want to use sub IDs, postbacks or ad tracking, sendingref_id to track/signup is not enough. These features rely on data captured when the visitor clicks the referral link: the sub ID (fp_sid) from the link, the landing page URL with any ad click IDs, and the visit itself. FirstPromoter only records that data when the click is tracked by the tracking script, and only links it to the referral when you send the visit’s tid.
To keep this data, use the tracking script for clicks and the API for signups:
1
Install the main tracking script
Add the main tracking script to every page a referral link can land on. When a visitor arrives through a referral link, the script tracks the click and sets the
_fprom_ref and _fprom_tid cookies.If visitors land on one domain and sign up on another, set up cross-domain tracking so the cookies are available where the signup happens.2
Read the _fprom_tid cookie at signup
When the visitor signs up, read the
_fprom_tid cookie on your server (or in the browser and send it to your server with the signup form).3
Send it as tid to track/signup
Pass the cookie value in the
tid parameter of track/signup. FirstPromoter uses it to find the tracked click, credit the right affiliate, and attach the sub ID, landing URL and ad data to the referral.3. Sales Tracking
If you are using Stripe, Chargebee, Braintree, Paddle or Recurly we can track sales automatically on our end. You will only need to connect your billing provider to FirstPromoter. When a sale event is received, FirstPromoter will automatically:- Identify the corresponding affiliate to assign the sale to.
- Assign the corresponding reward/commission to the promoter.