Getting started
Connect your first source
Video walkthrough
Overview
Sources define where data enters TrackLayer: browser tags, mobile SDKs, server libraries, or webhooks. Connecting a first source lets you tag traffic, apply consent, and centralize identity before events reach destinations.
Steps
- Navigate to Sources → Add source and pick Web, Mobile, or Server depending on where the event originates.
- Name the source (for example
production-web) and attach the domains or bundle IDs that should be allowed to emit data. - Install the snippet or SDK using the install panel. For web, add the loader once per page shell:
<script async src="https://cdn.tracklayer.io/sdk/v1/tracklayer.js" data-workspace="wksp_abc123"></script>
<script>
window.tracklayer = window.tracklayer || [];
tracklayer.push(["config", { consent: { default: "denied" } }]);
</script>- Emit a test event from that environment and confirm the live tail shows the source label you configured.
Troubleshooting
- CSP blocks: allowlist
cdn.tracklayer.ioand your ingestion host inscript-srcandconnect-src. - Duplicate events: ensure only one loader runs per page and dedupe with a stable
event_idon retries. - Mobile builds missing events often trace to background flush intervals—lower the flush threshold in debug builds while validating.