Skip to main content

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:
This snippet is safe to place anywhere on the page, including in the <head>. Calls to outlit.track() or outlit.user.identify() will be queued and processed once the SDK loads.

Simple Version

If you prefer a cleaner script tag and don’t need to call tracking methods before the SDK loads:
string
required
Your organization’s public key. Find it in Settings → Website Tracking.
string
Custom API host. Defaults to https://app.outlit.ai.
string
Set to "false" to disable automatic pageview tracking.
string
Set to "false" to disable automatic form capture.
string
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.
string
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.
string
Set to "false" to disable automatic tracking of calendar bookings from Cal.com and Calendly embeds. See Calendar Embed Tracking for details.
string
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.
string
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).
If you’re using a consent management platform (CMP) or need to wait for user consent before tracking, pass false as the last parameter to disable auto-tracking:
Or with the simple script tag:

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)
Automatically Removed 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 global window.outlit object to track custom events:

Track Custom Events

string
required
The name of the event. Use snake_case for consistency.
object
Optional properties to attach to the event.

Identify Visitors

When a visitor provides their email (signup, login, contact form), identify them:
string
The visitor’s email address.
string
Your internal user ID (from Supabase, Auth0, Firebase, etc.).
object
Additional properties about the user.
At least one of email or userId should be provided. Without identity information, the call has no effect.

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:

Activation event

Track the ordinary event selected as your activation signal after the milestone succeeds:
Configure this event as your activation signal. Outlit Core derives lifecycle stages from ordinary events, and billing status comes from verified integrations such as Stripe. See Customer Journey.

Get Visitor ID

Access the current visitor’s ID (useful for server-side correlation):

Queued Commands

The IIFE snippet creates stub methods that queue all tracking calls until the SDK fully loads. This means you can call outlit.track(), outlit.identify(), or any other method immediately—even in inline scripts before the SDK has finished loading:

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

  1. Check your public key is correct
  2. Verify the domain is in your allowlist (Settings → Website Tracking)
  3. Open DevTools → Network and check for errors in /api/i/v1/ requests
  4. Ensure the script loads without errors (check Console)
  1. Form must have a submit event (not prevented with e.preventDefault() before capture)
  2. Check if field names match the denylist (they may be filtered for security)
  3. Ensure data-track-forms is not set to "false"
The tracker automatically listens for pushState/replaceState. If using a custom router that doesn’t use these, manually track:

Next Steps

NPM Package

Use the npm package for more control

React Integration

First-class React support with hooks

Calendar Embeds

Track Cal.com and Calendly bookings