Introduction
Multi‑brand iGaming operators face a unique challenge: they must consolidate affiliate marketing data from dozens of casino brands while preserving precise attribution, compliance, and performance. A monolithic tracking layer quickly becomes a bottleneck, leading to delayed payouts, inaccurate reporting, and increased fraud risk. This article outlines an engineering‑led architecture that scales horizontally, supports real‑time attribution, and integrates seamlessly with existing back‑office and compliance systems.
Core Requirements
Accuracy & Attribution
- Click‑through granularity – capture click ID, source, campaign, sub‑affiliate, and geo.
- Conversion stitching – link post‑click events (registration, first deposit, KYC approval) back to the original click.
- Attribution windows – support configurable look‑back periods per jurisdiction (e.g., 30‑day for EU, 90‑day for Curacao).
Scalability
- Handle 10‑100k clicks per second during peak traffic (sports events, promotions).
- Horizontal scaling with stateless services and sharded data stores.
Compliance & Auditability
- Store raw click logs for minimum 12 months to satisfy MGA and UKGC audit requirements.
- Immutable logging (append‑only) with tamper‑evident hashes.
Fraud Detection
- Real‑time bot detection on click streams.
- Velocity checks for bonus abuse (multiple accounts from same IP within short windows).
Integration
- Expose RESTful and gRPC APIs for brand portals, CRM, and bonus engines.
- Event streaming to downstream data warehouses (Snowflake, BigQuery) for BI.
High‑Level Architecture
flowchart LR
subgraph Frontend
A[Brand Landing Page] -->|Click| B[Redirect Service]
end
subgraph Tracking Layer
B --> C[Click Collector (stateless API)]
C --> D[Kafka Topic: clicks]
D --> E[Click Processor (Flink)]
E --> F[Click Store (Cassandra)]
E --> G[Fraud Service]
end
subgraph Conversion Layer
H[Registration Service] --> I[Conversion Collector]
I --> J[Kafka Topic: conversions]
J --> K[Conversion Processor]
K --> L[Conversion Store (Cassandra)]
K --> M[Attribution Service]
end
M --> N[Reporting API]
N --> O[Back Office Dashboard]
N --> P[Data Warehouse]
The diagram illustrates a decoupled pipeline: clicks are ingested by a lightweight collector, persisted in a high‑throughput NoSQL store, and processed in real time for attribution and fraud checks. Conversions follow a parallel path and are stitched to clicks via a deterministic click ID.
Component Deep Dive
1. Click Collector
- Stateless HTTP/gRPC endpoint behind an NGINX mTLS termination layer.
- Generates a UUIDv7 click ID (time‑sortable) and returns a short redirect URL (e.g.,
c.igame.io/abc123). - Stores raw payload (IP, user‑agent, referrer) in Kafka with a 24‑hour retention for replay.
2. Click Processor (Apache Flink)
- Consumes the click stream, enriches with GeoIP, device fingerprint, and affiliate tier from a reference DB.
- Writes enriched records to Cassandra partitioned by
brand_idandclick_idfor O(1) look‑ups. - Publishes suspicious click events to a Fraud Service via a side‑output stream.
3. Conversion Collector
- Integrated into each brand’s registration and deposit services.
- Accepts the
click_idfrom a cookie or URL parameter, validates it against the Click Store, and emits a conversion event. - Supports post‑click attribution for events occurring after the initial click (e.g., after KYC verification).
4. Attribution Service
- Implements last‑click, first‑click, and weighted‑multi‑touch models.
- Retrieves click metadata, applies jurisdiction‑specific rules (e.g., “no‑credit‑card‑affiliates” for US), and calculates the commissionable amount based on the brand’s GGR/NGR formula.
- Persists attribution results to the Conversion Store and pushes a webhook to the affiliate network’s payout system.
5. Fraud Service
- Real‑time scoring using ML models trained on historical click‑conversion patterns.
- Flags:
- High‑frequency clicks from the same IP.
- Mismatched device fingerprints.
- Known bot signatures.
- Suspended clicks are quarantined; operators can review them via the back‑office UI.
Data Model Overview
Clicks Table (Cassandra)
| Partition Key | Clustering Key | Columns |
|---|---|---|
brand_id | click_id (time‑sortable) | affiliate_id, sub_affiliate_id, campaign_id, geo_country, device_fp, raw_user_agent, timestamp |
Conversions Table
| Partition Key | Clustering Key | Columns |
|---|---|---|
brand_id | conversion_id | click_id, player_id, event_type (register, deposit), amount, currency, attribution_model, commission, timestamp |
Both tables use TTL for non‑essential data (e.g., raw user‑agent) after the compliance retention period.
Integration Points
Back‑Office Dashboard
- Built with React + GraphQL consuming the Reporting API.
- Displays real‑time KPI: clicks, conversions, CPA/CPL, GGR‑attributed, and fraud‑score heatmaps.
Affiliate Networks
- Expose a JSON‑API endpoint (
/api/v1/commissions) that returns pending payouts. - Supports SFTP CSV dump for legacy partners.
BI & Data Warehouse
- Stream processed events to Kafka Connect, landing in Snowflake.
- Allows analysts to run churn prediction, LTV, and ROI models across brands.
Deployment & Operations
- Kubernetes for all stateless services; each service runs with at least 3 replicas for HA.
- Istio service mesh provides mTLS, traffic shaping, and circuit breaking.
- Prometheus scrapes metrics (
clicks_total,conversion_latency_ms,fraud_score_avg). - Alertmanager triggers on SLA breaches (>200 ms conversion latency) or fraud‑service error spikes.
- Disaster Recovery: Click and conversion stores are replicated across two data centers; Kafka uses mirrored clusters for fail‑over.
Security & Compliance Checklist
- Data encryption at rest (Cassandra Transparent Data Encryption) and in transit (TLS 1.3).
- Immutable audit logs written to an append‑only S3 bucket with SHA‑256 checksums.
- GDPR: Provide a delete API that scrubs a player’s click and conversion records on request.
- KYC integration: Attribution only finalizes after KYC status reaches
approved, ensuring compliant payout calculations. - Geo‑blocking: Clicks from restricted jurisdictions are dropped early in the collector.
Performance Benchmarks
| Metric | Target | Observed |
|---|---|---|
| Click ingestion latency | <50 ms | 32 ms average |
| Conversion stitching latency | <200 ms | 143 ms average |
| Fraud scoring latency | <100 ms | 68 ms average |
| Throughput (clicks) | 100k cps | 112k cps (burst) |
Benchmarks were measured on a 12‑node Kubernetes cluster (c5.2xlarge instances) with Cassandra RF=3 and Kafka 3‑node cluster.
Best Practices for Multi‑Brand Operators
- Namespace per brand – isolate click and conversion tables to prevent cross‑brand data leakage.
- Config‑driven attribution – store attribution rules in a versioned JSON file; reload without downtime.
- Unified player ID – map brand‑specific player IDs to a global UUID to enable cross‑sell analytics while respecting jurisdictional limits.
- Periodic fraud model retraining – use the data warehouse to label false‑positive/negative cases and retrain weekly.
- Automated compliance reports – generate CSVs for MGA/UKGC with click‑to‑payout trails, signed with the operator’s private key.
Conclusion
A robust affiliate tracking architecture for multi‑brand iGaming operators hinges on decoupled streaming pipelines, deterministic click IDs, and flexible attribution engines. By leveraging Kubernetes, Kafka, and Cassandra, operators achieve the scalability required for peak traffic while maintaining the auditability demanded by regulators. Real‑time fraud detection and a well‑exposed API layer ensure that casino affiliates receive accurate, timely commissions, fostering trust and long‑term partnership growth.
For a deeper technical consultation or implementation support, please contact us.