How It Works
Understanding the SDK's tracking flow and how attribution works under the hood.
Tracking Flow
When the SDK loads on a visitor's page, it follows a four-step process to capture and store referral attribution:
Detects referral parameter
On load, the SDK checks the URL for a ?ref=CODE parameter. If found, it stores the referral code.
Stores in first-party cookie
The referral code is saved in a first-party cookie (_ak_ref). The cookie duration matches your program's cookie window setting.
Tracks page view
A page_view event is sent to Icodrip with the referral code, page URL, and referrer.
Attribution happens server-side
When a payment webhook arrives, Icodrip matches the customer to the stored referral and creates a conversion.
Attribution
The SDK is entirely optional. Server-side tracking via payment webhooks works without any client-side code — Icodrip can still attribute conversions when customers arrive through affiliate links and complete a purchase.
The SDK adds enhanced tracking capabilities on top of the baseline webhook attribution: page views give you visibility into the full customer journey, custom events let you track meaningful actions before a purchase, and user identification connects anonymous visitor sessions to known customers for more accurate attribution.