Installing Jolt is as simple as adding a single line of code to your website's HTML. This script will automatically track page views and basic visitor data.
Copy and paste the following script tag into the <head> section of your website's HTML:
You can customize the script's behavior using data attributes:
data-domain: (Required) Your website's domain as registered in Jolt.data-api-host: (Optional) Use a custom API endpoint for tracking.data-auto-page-view: (Optional) Set to "false" to disable automatic pageview tracking. Default is "true".data-auto-events: (Optional) Set to "true" to track safe form submissions, outbound clicks, downloads, and supported 404 responses. Automatic events are disabled by default.data-skip-patterns: (Optional) A comma-separated list of path patterns to ignore (e.g., "/admin/*, /login").data-mask-patterns: (Optional) A comma-separated list of path patterns to mask in the dashboard.data-cookie-on-identify: (Optional) Set to "true" to enable cookie-based visitor identification.With data-auto-events="true", Jolt sends the following events without extra JavaScript:
form_submit with the form ID, name, action, and method when available.outbound_click with the external URL and host.file_download with the file URL, name, and extension.page_not_found when the browser exposes a 404 response status.Each automatic event counts as one event toward your plan usage.
Jolt never reads form field values, and removes query strings and fragments from form actions and link URLs. Add data-jolt-ignore to a form or link to skip its automatic event. For client-side routers and browsers that do not expose the response status, call window.jolt?.pageNotFound() from the not-found page.
Track a specific interaction with the data-jolt-event attribute. You can also pass additional data using data-jolt-event-[key] attributes. Explicit events work even when automatic pageviews or automatic events are disabled, and take priority over data-jolt-ignore.
On a <form>, the explicit event fires from the submit event. Only declared data-jolt-event-* properties are sent; input values are never collected.
After a user signs in, identify them with the same stable ID used by your backend. This connects browser and server events in Users and Flows.
Use the Node.js SDK for trusted events created on your server, such as completed payments, subscriptions, and processed jobs. It requires Node.js 18 or newer.
npm install @jolt-analytics/nodeimport { Jolt } from '@jolt-analytics/node'
const jolt = new Jolt({
writeKey: process.env.JOLT_WRITE_KEY
})
await jolt.track('subscription_started', {
userId: user.id,
properties: { plan: 'pro' }
})Create a write key in Project Settings, under Analytics and Backend. Keep it in a server environment variable and never expose it in browser code.
Once you've added the script, visit your website and then check your Jolt dashboard. You should see yourself appearing in the "Real-time" section within a few seconds.