How a click reaches your site
Affiliates share short links on your tracking domain, such as https://go.yourbrand.com/k3x9p. Affiliates may add sub and sub1 to sub5 parameters for their own reporting. When a visitor opens the link, Affinix records the click and redirects with a 302 to the campaign destination, adding the aff parameter:
https://yourbrand.com/welcome-bonus?aff=SEdBN0x2...%3DThe aff value is an opaque, signed code that identifies the affiliate, campaign, link and click. Treat it as a string: do not parse, shorten or change it.
Keep the code through signup
Visitors often browse before they register. Save the aff value when they land and attach it to the player when the account is created.
- Store it in a first-party cookie or your session, for the attribution period your terms promise affiliates (30 days is common).
- If a visitor arrives again with a different code, keep the newest one (last click wins), unless your affiliate terms say otherwise.
- Store the code on the player record. You send it back with the player and with every activity row.
- Values can be up to 2,048 characters. The code may reach you URL-encoded once or twice; Affinix accepts both, so store what you receive.
// Run on every page of your casino site.
const aff = new URLSearchParams(window.location.search).get('aff');
if (aff) {
document.cookie = `affinix_aff=${encodeURIComponent(aff)}; Max-Age=${30 * 86400}; Path=/; SameSite=Lax; Secure`;
}// After the player account is created:
$aff = $_COOKIE['affinix_aff'] ?? null;
if ($aff !== null) {
$player->setAffiliateCode(rawurldecode($aff)); // keep it on the player
$affinix->sendPlayer($player); // see POST /players
}Advanced: reading the code
Most integrations never need to read the code. If your platform wants the affiliate number itself, for example to show it in your back office, the code is encrypted with the brand’s token key (AES-128-GCM), shown on the Connection page. The format is described in the OpenAPI specification.