The TrustData Tracking SDK is a lightweight JavaScript library that gives you complete visibility into your traffic—not just the visitors who consent.
Traditional analytics only shows you consented traffic. TrustData shows you:
| Traditional Analytics | TrustData |
|---|---|
| ~70% of visitors (consented only) | 100% of visitors |
| No consent rate data | Exact consent acceptance rate |
| Blocked by ad blockers | Adblock detection and rate |
| Third-party cookies (often blocked) | First-party tracking |
Third-party cookies are increasingly blocked:
TrustData uses first-party tracking:
┌─────────────────────────────────────────────────────────────┐
│ Your Website │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ TrustData SDK (t.js) │ │
│ │ • Captures pageviews and events │ │
│ │ • Extracts URL parameters (trdt_cid, utm_*, gclid) │ │
│ │ • Manages visitor identity (local storage) │ │
│ │ • Tracks consent state and adblock status │ │
│ │ • Queues and batches events │ │
│ └─────────────────────┬────────────────────────────────┘ │
└─────────────────────────┼───────────────────────────────────┘
│ HTTPS POST
▼
┌─────────────────────────────────────────────────────────────┐
│ TrustData Event Server (Go) │
│ • High-performance ingestion │
│ • Validates and enriches events │
│ • Geo IP and device detection │
│ • Bot filtering │
│ • Writes directly to ClickHouse │
└─────────────────────────────────────────────────────────────┘
The SDK automatically captures:
| Category | Data |
|---|---|
| Identity | Visitor ID, session ID, user ID (if authenticated) |
| Attribution | UTM parameters, click IDs (gclid, fbclid, ttclid, msclkid) |
| Session | Session number, first visit flag, entrance page |
| Page | URL, referrer, title |
| Device | Browser, OS, screen size, device type |
| Privacy | Consent state (4 levels), adblock detection |
TrustData tracks a 4-level consent model:
| Level | Purpose |
|---|---|
| Analytics | Basic analytics and performance measurement |
| Advertising | Ad targeting and conversion tracking |
| Preferences | Personalization and saved settings |
| Sale of Data | Third-party data sharing (CCPA) |
You can see your consent acceptance rate for each level in the dashboard.
The SDK detects ad blockers and reports:
This helps you understand how much traffic is invisible to standard analytics.
| Feature | JavaScript SDK | Server-Side API |
|---|---|---|
| Pageviews | Automatic | Manual |
| Client data | Full (device, referrer) | Limited |
| Ad blockers | May be blocked | Always works |
| Conversions | Both | Recommended |
| Consent/Adblock rates | Yes | No |
Recommendation: Use the JavaScript SDK for pageviews, consent tracking, and client-side events. Use the server-side API for backend conversions (purchases, signups) to ensure they're always captured.