TrustData
Tracking SDK

Overview

First-party event tracking with full visibility—including consent rates and adblock detection.

The TrustData Tracking SDK is a lightweight JavaScript library that gives you complete visibility into your traffic—not just the visitors who consent.

What makes it different

Traditional analytics only shows you consented traffic. TrustData shows you:

Traditional AnalyticsTrustData
~70% of visitors (consented only)100% of visitors
No consent rate dataExact consent acceptance rate
Blocked by ad blockersAdblock detection and rate
Third-party cookies (often blocked)First-party tracking

Why first-party tracking?

Third-party cookies are increasingly blocked:

  • Safari: Blocks all third-party cookies
  • Firefox: Blocks known trackers
  • Chrome: Phasing out third-party cookies
  • Ad blockers: Block most analytics scripts

TrustData uses first-party tracking:

  • Data is collected on your domain
  • No third-party cookies required
  • Works with all browsers
  • You own the data

Architecture

┌─────────────────────────────────────────────────────────────┐
│                      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                            │
└─────────────────────────────────────────────────────────────┘

What the SDK captures

Automatic data capture

The SDK automatically captures:

CategoryData
IdentityVisitor ID, session ID, user ID (if authenticated)
AttributionUTM parameters, click IDs (gclid, fbclid, ttclid, msclkid)
SessionSession number, first visit flag, entrance page
PageURL, referrer, title
DeviceBrowser, OS, screen size, device type
PrivacyConsent state (4 levels), adblock detection

TrustData tracks a 4-level consent model:

LevelPurpose
AnalyticsBasic analytics and performance measurement
AdvertisingAd targeting and conversion tracking
PreferencesPersonalization and saved settings
Sale of DataThird-party data sharing (CCPA)

You can see your consent acceptance rate for each level in the dashboard.

Adblock detection

The SDK detects ad blockers and reports:

  • Whether the visitor has an ad blocker active
  • Which blocking platform (if identifiable)
  • Your overall adblock rate

This helps you understand how much traffic is invisible to standard analytics.

Key features

Lightweight

  • < 5KB gzipped
  • Async loading (non-blocking)
  • No external dependencies

Privacy-focused

  • No fingerprinting
  • Local storage only (no cookies)
  • Respects Do Not Track
  • Easy consent integration
  • IP anonymization option

Configurable

  • Session timeout (default 30 minutes)
  • Attribution lookback window (default 30 days)
  • Cross-domain tracking
  • Internal traffic filtering
  • Bot filtering (built-in + custom patterns)

SDK vs server-side

FeatureJavaScript SDKServer-Side API
PageviewsAutomaticManual
Client dataFull (device, referrer)Limited
Ad blockersMay be blockedAlways works
ConversionsBothRecommended
Consent/Adblock ratesYesNo

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.

Next steps

Installation and configuration guide.
Standard events and custom event tracking.