Affiliate attribution
pf_ref identifies a promo participant; it is not a built-in affiliate commission or payout system. Use explicit checkout metadata for affiliate click IDs, and configure the receiving affiliate platform to recognize those fields. A reference supplied by the browser is attribution context, not verified identity or authority to pay a commission.
Capture a reference from the URL
https://example.com/sales-page?pf_ref=partner_123When the SDK loads, it can attach that reference to the visitor identity and later checkout calls.
Pass explicit metadata
For affiliate platforms that expose a click ID or referral code in JavaScript, pass metadata at checkout time.
await plandalf.present("pro-plan", {
metadata: {
affiliate_click_id: window.tolt_referral,
source: "partner"
}
});Lazy metadata
If an affiliate script loads after the Plandalf script, configure metadata as a function so it is evaluated when the checkout session is created.
plandalf("configure", {
metadata: {
tolt_referral: () => window.tolt_referral
}
});Verify after purchase
Listen for purchase events and confirm the resulting invoice or webhook contains the expected attribution context.
const handle = plandalf.present("pro-plan");
for await (const event of handle.events) {
if (event.type === "purchase") {
console.log(event.invoice);
}
}