Add the tracker
Place this tag before the closing</body> tag and replace the example key. The public key is designed to appear in browser code; the enabled-domain list controls which sites can send events with it.
data-auto-track behavior already keeps tracking off in regions that require opt-in consent (EEA, UK, Switzerland, or unknown). To wait for enableTracking() instead — unless a previous opt-in is stored — set data-auto-track="false" on the tag and call window.outlit.enableTracking() only after the visitor accepts. A saved opt-out persists across visits until tracking is enabled again. See Consent management for the complete pattern.
Identify a visitor
After someone signs in or gives you their email, identify the same browser visitor with that email to link earlier website activity to a known contact. IncludeuserId when your app has one; a call without either an email or userId has no effect.
identify() after tracking is enabled. For identity that must be queued before consent, use the script tag’s setUser() pattern.
Send a product event
Calltrack() when a meaningful action succeeds and tracking is allowed:
Check the result
Open the identified customer’s profile in Customers and look for the event in its activity timeline. If nothing appears, confirm the test domain is enabled under Settings → Website Visitors, tracking consent is active, and the identity call includedemail or userId. The script tag troubleshooting guide covers delivery and loading problems.
Next steps
Script tag options
Configure automatic tracking, consent, and identity.
npm package
Add tracking to a JavaScript app with explicit configuration.
Outlit Node.js SDK
Send events from a backend or background job.
How tracking works
See how events join customer profiles and timelines.
