Using a shop or billing platform? Check the integrations in the help center first: most of them set this up for you.
Setup
Add the snippet to every page of your site, so a click is recorded wherever the visitor lands:conversion, customer, trial or lead on the page where the sale or sign-up happens. Calls are queued, so they work before the script has loaded.
These calls only reach Tapfiliate when the visitor came through an affiliate within the program’s cookie time. For everyone else nothing is sent, so the code can stay on the page for all visitors.
create
Initializes tapfiliate.js.detect
Looks for affiliate tracking parameters in the URL. If it finds them, it records a click and sets a cookie, so a later conversion is attributed to the affiliate. Without tracking parameters it makes no request.conversion
Tracks a conversion, usually a purchase. Put it on your thank-you page.conversionMulti
Tracks one conversion with several commissions, for example a different rate per product category.options is the same as for conversion. commissions is an array with one object per commission:
customer, trial and lead
Track a customer when a referred visitor signs up, before they pay. Conversions you track later for the samecustomer_id are attributed to the same affiliate.
trial and lead work like customer and set the customer’s initial status to trial or lead. Use trial for SaaS and subscriptions, lead for lead generation and long sales cycles.
click
Records a click from tracking parameters you pass explicitly.trackingParameters holds either a referral code or an asset ID and source ID, for example { referral_code: 'janejameson' } or { asset_id: '1-abcdef', source_id: '2-cdefgh' }. The only option is always_callback.
Callbacks
By default the callbacks ofdetect, conversion, conversionMulti, customer and click fire only on success. Pass always_callback: true in the options to get every outcome, with the conventional signature: