Overview
The script tag integration is the simplest way to add Outlit tracking to your website. It works on any site—static HTML, WordPress, Webflow, or any other platform.Installation
Add this snippet before the closing</body> tag. This creates a lightweight stub that queues calls until the full SDK loads, ensuring zero impact on page load speed:
Simple Version
If you prefer a cleaner script tag and don’t need to call tracking methods before the SDK loads:Your organization’s public key. Find it in Settings → Website Tracking.
Custom API host. Defaults to
https://app.outlit.ai.Set to
"false" to disable automatic pageview tracking.Set to
"false" to disable automatic form capture.Set to
"false" to disable automatic tracking on load. Use this when you need to wait for user consent before tracking. Call window.outlit.enableTracking() after consent is obtained.Set to
"false" to disable automatic user identification from form submissions. When enabled (default), submitting a form with an email field automatically calls identify() with the extracted email and name. See Auto-Identify for details.Set to
"false" to disable automatic tracking of calendar bookings from Cal.com and Calendly embeds. See Calendar Embed Tracking for details.Set to
"false" to disable engagement tracking (active time on page). When enabled (default), emits engagement events on page exit and navigation capturing how long users actively engaged with each page.Idle timeout in milliseconds for engagement tracking. After this period of no user interaction, the user is considered idle and active time stops accumulating. Default is
"30000" (30 seconds).Consent Management
If you’re using a consent management platform (CMP) or need to wait for user consent before tracking, passfalse as the last parameter to disable auto-tracking:
With Popular CMPs
- OneTrust
Check Tracking Status
Automatic Tracking
Once installed, the tracker automatically captures:Pageviews
Every page navigation is tracked, including:- Full URL and path
- Page title
- Referrer
- UTM parameters (
utm_source,utm_medium,utm_campaign,utm_term,utm_content)
For single-page applications, the tracker automatically detects navigation via
pushState, replaceState, and popstate events.Form Submissions
When a form is submitted, the tracker captures:- Form ID or name
- All field values (except sensitive fields)
- Passwords (
password,passwd,pwd) - Credit card numbers (
credit_card,cc_number,cvv) - Social Security numbers (
ssn,social_security) - API keys and tokens (
api_key,token,secret)
Manual Tracking
Use the globalwindow.outlit object to track custom events:
Track Custom Events
The name of the event. Use snake_case for consistency.
Optional properties to attach to the event.
Identify Visitors
When a visitor provides their email (signup, login, contact form), identify them:The visitor’s email address.
Your internal user ID (from Supabase, Auth0, Firebase, etc.).
Additional properties about the user.
Set User Identity
For SPA applications where you know the user’s identity after authentication:setUser() can be called before tracking is enabled (with data-auto-track="false"). The identity is queued and applied when enableTracking() is called.Clear User Identity
Call when the user logs out:Journey Stage Methods
Track user progression through your product lifecycle. These require the user to be identified first (viasetUser() or identify()).
Get Visitor ID
Access the current visitor’s ID (useful for server-side correlation):Queued Commands
The tracker supports commands even before it fully loads. Commands are queued and executed once ready:Event Batching
For performance, events are batched and sent:- Every 5 seconds (if there are pending events)
- When the queue reaches 10 events
- When the page is about to unload (using
sendBeacon)
Example: Full Integration
Troubleshooting
Events not appearing in dashboard
Events not appearing in dashboard
- Check your public key is correct
- Verify the domain is in your allowlist (Settings → Website Tracking)
- Open DevTools → Network and check for errors in
/api/i/v1/requests - Ensure the script loads without errors (check Console)
Form data not captured
Form data not captured
- Form must have a submit event (not prevented with
e.preventDefault()before capture) - Check if field names match the denylist (they may be filtered for security)
- Ensure
data-track-formsis not set to"false"
Pageviews not tracking on SPA
Pageviews not tracking on SPA
The tracker automatically listens for
pushState/replaceState. If using a custom router that doesn’t use these, manually track: