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

Loading diagram…

On your site, the SDK captures pageviews and events, extracts URL parameters (trdt_cpid/agid/kwid/ctid, utm_*), manages visitor identity (cookie + local storage), tracks consent and adblock status, then queues and batches events.

The event server then ingests at high throughput, validates and enriches each event, detects geo (from IP) and device, filters bots, and stores the result in your analytics database.

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 platforms are being blocked
  • Your overall adblock rate

Detection probes the endpoints that the major marketing platforms rely on, so you can see exactly which ones are blocked:

PlatformWhat gets blocked
google_analyticsGoogle Analytics collection
google_tag_managerGoogle Tag Manager container
google_adsGoogle Ads / AdSense
facebookMeta Pixel
tiktokTikTok Pixel
microsoftMicrosoft (Bing) Ads

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
  • Consent-aware storage: no client-side storage without consent, first-party cookie with consent
  • 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.

Tracking product page on trustdata.tech · Free trial