SublimDocs

Configuration

Options are passed in sublim.o with the script tag, or to init() with the npm package. Only projectId is required.

JavaScript
sublim.o = {
  projectId: 'YOUR_PROJECT_ID',
  hashMode: true,
  debug: true,
};

Project

OptionTypeDefaultDescription
projectIdstring—Required. Your project's ID (Settings → Installation). Needed for e-commerce detection, the dataLayer and session replay.
workspaceIdstring—Optional. Alone, without projectId, it lets Sublim find the project from the site's domain (beta, must be enabled for your workspace).

Pageviews

OptionTypeDefaultDescription
autocapturebooleantrueTracks client-side navigations (pushState, replaceState, back/forward) as pageviews.
trackPageviewbooleantrueSends the pageview of the initial page load. With autocapture on, that pageview is sent anyway: set both to false to send every pageview yourself.
hashModebooleanfalseFor apps routed with the URL hash (#/page): the hash becomes the page, and hash changes count as pageviews.

See Pageviews & SPAs.

Automatic tracking

OptionTypeDefaultDescription
trackFormsbooleantrueLead form submissions (form_submit). See Forms & leads.
trackDownloadsbooleantrueFile download clicks (file_download). See File downloads.
trackAddToCartbooleantrueAdd-to-cart button clicks (add_to_cart).
addToCartPatternsstring[]built-in listButton texts that count as add-to-cart. Replaces the built-in multilingual list. Matching is case-insensitive and partial.
trackCartbooleantrueCart total and purchase detection on the cart and thank-you pages set in the dashboard. See E-commerce.
dataLayerbooleanproject settingForward Google dataLayer (GA4 / GTM) events. true / false override the project's setting. See Google dataLayer.
dataLayerNamestring'dataLayer'Name of the dataLayer variable, if your tag manager uses another one.

Session replay

OptionTypeDefaultDescription
sessionReplaybooleantrueRecords sessions when replay is enabled for the project (and within its quota). Also enables the frustration signals.
replaymodule or () => import(…)—npm only. Bundles the recorder instead of loading it from the CDN: replay: () => import('@sublim_analytics/tracker/replay').
sessionReplayBatchSizenumber250Recording events sent per batch.
sessionReplayBatchIntervalnumber (ms)5000Maximum time between two batches.

See Session replay.

Environment

OptionTypeDefaultDescription
trackLocalhostbooleanfalseTrack on localhost, 127.0.0.1 and [::1]. Use it in development only.
debugbooleanfalseLogs what the tracker does in the browser console.
endpointstringhttps://tracker.sublimanalytics.com/api/v2/eventsIngestion URL. Only change it if Sublim gives you another one.
cdnUrlstringhttps://cdn.sublimanalytics.comWhere the session replay scripts are loaded from.

Settings managed in the dashboard

Some behaviour is configured per project in the dashboard rather than in the snippet. The tracker fetches it on its own and caches it in localStorage.

  • Thank-you page URL and cart page URL, used by purchase and cart detection.
  • Google dataLayer: on/off, the list of forwarded events, and whether to wait for consent.
  • Session replay: on/off and quotas.
  • Exclusions: IPs, paths, hostnames and countries that are ignored.