We're excited to have you use the Intelitics SDK! The web tracking and conversion SDK captures the affiliate click ID that brought a visitor to your site, persists it across the visitor's journey, and reports registration and deposit conversions back to your Intelitics tracking endpoint. Every signup and first deposit is attributed to the marketing click that drove it.
Please note this SDK is intended for operator websites (casino, sportsbook, etc.) to embed on their marketing, registration, and deposit pages. Additionally, URLs will need to include Intelitics click id (icid) parameters and its dynamic variable.
How it Works
Here is a brief overview of how the SDK works:
- A visitor arrives on a landing page from a tracking link that carries a click ID, e.g.
https://yourcasino.com/?icid=abc123. - On
init, the SDK reads thaticidfrom the URL and stores it for the rest of the session (and across sessions, if cookies are enabled). - When the visitor registers, you call
trackRegistration(). - When the visitor makes their first deposit, you call
trackDeposit(). - The SDK attaches the stored click ID to each event and sends it to your conversion endpoint - no need to thread the click ID through your own code.
This is what the typical journey would look like:
Land (?icid=…) → Register → Deposit
init() trackRegistration() trackDeposit()Installation
You can use the SDK two ways. Both expose the same API.
Option A - NPM (bundler / framework apps)
Please use this method if your site is built with a bundler (Vite, webpack, Next.js, etc.).
npm install @intelitics/sdk
# or: pnpm add @intelitics/sdk
# or: yarn add @intelitics/sdkimport InteliticsSDK from "@intelitics/sdk";
InteliticsSDK.init({ endpoint: "https://track.yourcasino.com" });The package ships ESM, CommonJS, and TypeScript type definitions, so import and require both work and you get full autocomplete.
Here is a quick start on how to use via NPM
import InteliticsSDK from "@intelitics/sdk";
// 1. Initialize once, as early as possible on page load.
InteliticsSDK.init({ endpoint: "https://track.yourcasino.com" });
// 2. After a successful registration:
await InteliticsSDK.trackRegistration({ playerId: "player-42" });
// 3. After the player's first deposit:
await InteliticsSDK.trackDeposit({
playerId: "player-42",
amount: 50,
currency: "USD",
vertical: "CASINO",
});Option B - CDN script tag (no build step)
Please use this if you're adding the SDK to a page directly (tag manager, server- rendered template, plain HTML). The script attaches the SDK to window.intelitics.
<!-- Load the SDK -->
<script src="https://cdn.intelitics.com/sdk/intelitics.min.js"></script>
<!-- Initialize it -->
<script>
intelitics.init({ endpoint: "https://track.yourcasino.com" });
</script>Place the loader <script> as early as possible (ideally in <head>) so the click ID is captured on the first page load.
Here is a quick start on how to use via CDN
<script src="https://cdn.intelitics.com/sdk/intelitics.min.js"></script>
<script>
intelitics.init({ endpoint: "https://track.yourcasino.com" });
</script>
<!-- Later, when the player registers -->
<script>
intelitics.trackRegistration({ playerId: "player-42" });
</script>
<!-- Later, when the player deposits -->
<script>
intelitics.trackDeposit({
playerId: "player-42",
amount: 50,
currency: "USD",
vertical: "CASINO",
});
</script>Configuration - init(config)
Call init exactly once, before any tracking calls. endpoint is the only required field.
InteliticsSDK.init({
endpoint: "https://track.yourcasino.com", // required
cookiesEnabled: true, // persist across sessions (see Consent)
cookieMaxAgeDays: 30, // cookie lifetime
clickIdParam: "icid", // URL param the click ID arrives on
});| Option | Type | Default | Purpose |
|---|---|---|---|
endpoint |
string |
(required) | Base URL of your Intelitics conversion endpoint. |
cookiesEnabled |
boolean |
false |
When true, the click ID and customer ID persist in cookies across page loads and sessions. When false, they live only in memory for the current page. See Consent & storage. |
cookieMaxAgeDays |
number |
30 |
How long the cookies live, in days. |
clickIdParam |
string |
"icid" |
The URL query param the click ID arrives on. |
clickIdStoreKey |
string |
"clickId" |
Storage key used to persist the click ID. |
Tracking conversions
Both tracking methods are asynchronous and return a Promise. They read the stored click ID automatically, you never pass it in. If no click ID was ever captured (the visitor didn't arrive with ?icid=…), the call throws, this is because there is nothing to attribute the conversion to.
trackRegistration(params?)
Report that a visitor created an account
await InteliticsSDK.trackRegistration({
playerId: "player-42", // your internal player ID (optional but recommended)
transactionId: "reg-2024-001", // optional idempotency / reference key
// time: "2026-06-23T10:00:00Z", // optional - defaults to now
});| Param | Type | Notes |
|---|---|---|
playerId |
string |
Your player identifier. Most commonly supplied. |
transactionId |
string |
Optional reference key for the event. |
time |
Date | number | string |
When the conversion happened. Defaults to now; only set it when reporting a past event (e.g. replaying a failed fire). Sent to the wire in UTC. |
trackDeposit(params?)
Report a deposit (most commonly the player's first)
await InteliticsSDK.trackDeposit({
playerId: "player-42",
amount: 50,
currency: "USD", // case-insensitive
vertical: "CASINO",
transactionId: "txn-9876",
});| Param | Type | Notes |
|---|---|---|
amount |
number |
Deposit amount. Must be provided together with currency. |
currency |
string |
One of AUD, BTC, CAD, EUR, GBP, INR, USD (case-insensitive). Must be provided together with amount. |
vertical |
string |
Product vertical (see list below). |
playerId |
string |
Your player identifier. |
transactionId |
string |
Optional reference key for the event. |
time |
Date | number | string |
When the deposit happened. Defaults to now. Sent in UTC. |
Please note amount and currency are coupled.
Pass both, or neither (for a bare deposit event). Passing only one throws an error.
Please see below for the list of supported verticals.
Supported verticals: BINGO, CASINO, CRYPTO, ESPORTS, FANTASY, FOREX, HORSE_RACING, LIVE_DEALER, LOTTERY, OTHER, POKER, SLOTS, SPORTSBOOK, SWEEPSTAKES, TABLE_GAMES, VIRTUAL.
Cross-session identity stitching
Your landing page(s) also carry a customer ID, the SDK can keep a returning, known customer attributed to their original click across sessions.
When the SDK initializes and sees that the same customer has returned but arrived on a new click ID, it automatically calls the tracking endpoint to merge the old and new click IDs. This means a conversion that happens later still attributes correctly to the original click, even if the customer came back through a different link.
Ex:
- Visitor clicks on a tracking link
- Click ID 123 is generated
- Customer ID cust-001 is generated
- Visitor clicks on a second link
- Click ID 456 is generated
- Customer ID cust-002 is generated
- Visitor clicks on a third link
- Click ID 789 is generated
- Customer ID cust-003 is generated
- Visitor registers while on the third link
- Click ID 789 will be attributed with the registration event
- Customer ID cust-001 will be associated with click id 789
This is fully automatic, the customer ID will be generated on the Intelitics end:
https://yourcasino.com/?icid=newclick456For identity stitching to work across sessions, cookies must be enabled so the original click ID persists between visits (the in-memory store starts empty on every page load).
Consent & storage
Storage is off by default (cookiesEnabled: false), meaning the click ID lives only in memory for the current page view. The SDK does not try to auto-detect consent, your Consent Management Platform (CMP) owns that decision. There are various methods a visitor can be notified to consent to enabling cookies such as through a banner notification or a pop up. The decision on how to notify your visitor falls within your business. If cookies are to be enabled you must also consider how to set the necessary code in order to properly track the visitor attribution.
Enable persistent (cookie) storage once the visitor has consented:
// At init, if consent is already known:
InteliticsSDK.init({
endpoint: "https://track.yourcasino.com",
cookiesEnabled: true,
});
// Or flip it later, once your CMP reports consent:
InteliticsSDK.setCookiesEnabled(true); When the storage mode changes, the SDK migrates the current click/customer IDs to the new store and cleans up the old one.
Clearing stored data
To wipe the stored click ID (e.g. on logout or consent withdrawal):
InteliticsSDK.clear(); API reference
| Method | Description |
|---|---|
init(config) |
Initialize the SDK. Call once before anything else. |
trackRegistration(params?) |
Report a registration conversion. Returns Promise<void>. |
trackDeposit(params?) |
Report a deposit conversion. Returns Promise<void>. |
setCookiesEnabled(enabled) |
Switch between cookie (persistent) and memory storage at runtime. |
clear() |
Remove the stored click ID. |
All methods are static, call them directly on the imported InteliticsSDK (NPM) or on window.intelitics (CDN).
Error handling
Calling a tracking method, setCookiesEnabled, or clear before init throws an SDKNotInitializedError.
trackDeposit throws if amount/currency are not provided together, or if the currency is unsupported.
Tracking calls also throw if no click ID is available in the session.
try {
await InteliticsSDK.trackDeposit({ amount: 50, currency: "USD" });
} catch (err) {
// Log and continue - a failed conversion report should not break your UX.
console.error("Intelitics tracking failed:", err);
}TypeScript
The package ships full type definitions. Parameter and config types are exported for use in your own code:
import InteliticsSDK, {
type DepositParams,
type RegistrationParams,
type InteliticsConfig,
} from "@intelitics/sdk";
const config: InteliticsConfig = {
endpoint: "https://track.yourcasino.com",
cookiesEnabled: true,
};
InteliticsSDK.init(config);