API Reference
The SDK exposes a global ak object with methods for tracking events, identifying users, and managing referral data.
ak.track()
ak.track(eventName, properties?)Track a custom event with optional properties. Use this for signup completions, plan selections, feature usage, or any other meaningful action.
ak.track("checkout_started", { plan: "business", value: 9900 });ak.identify()
ak.identify(email)Link the current visitor to a customer email address. Call this after signup or login to connect the referral click to a known customer.
ak.identify("jane@example.com");ak.getRef()
ak.getRef()Returns the current referral code stored in the cookie, or null if no referral is active.
const ref = ak.getRef(); // "john-doe" or null
ak.reset()
ak.reset()Clear all stored referral data. Use this when a user logs out or you want to reset attribution.
ak.reset();