What the Tracking Script Does

Overview

The Convert tracking script is a lightweight JavaScript library that runs on your website to power A/B testing, multivariate testing, split URL testing, and personalisation. When a visitor loads a page, the script:

  1. Identifies the visitor — Assigns a unique visitor ID stored in a first-party cookie, or uses your own ID via the BYOID API
  2. Evaluates targeting rules — Checks if the visitor matches audience conditions (location, device, browser, behaviour, custom data) and whether the current page matches any active location triggers
  3. Delivers experiences — Selects a variation using a deterministic bucketing algorithm, then applies the changes (CSS, HTML, JavaScript, redirects) to the page
  4. Tracks conversions — Monitors goal events (clicks, page visits, form submissions, scroll depth, revenue, custom triggers) and attributes them to the active experiences
  5. Sends data to integrations — Forwards experience and conversion data to connected analytics platforms (Google Analytics, Mixpanel, Hotjar, Segment, and 18 others)

Key Characteristics

  • First-party cookies only — All cookies are set on your domain. No third-party cookies are used.
  • Privacy-first — No personally identifiable information is stored. Supports consent mode, cookie-less testing, and GDPR/CCPA compliance out of the box.
  • SPA-aware — Automatically detects URL changes in single-page applications and re-evaluates experiences without a full page reload.
  • Anti-flicker — Hides the page body briefly while variations are applied, preventing the flash of original content (configurable).
  • Asynchronous data loading — Geographic and weather data are fetched only when needed by targeting rules, avoiding unnecessary network requests.

What Gets Loaded

The tracking script is a single JavaScript file specific to your account and project:

https://cdn-4.convertexperiments.com/v1/js/[account_id]-[project_id].js

The base size is approximately 50 kB (compressed). This can increase depending on the number of active experiences, locations, audiences, and goals configured in the project.

How It Fits Together

The tracking script works alongside two other components you configure in the Convert app:

  • Experiences — The A/B tests, multivariate tests, split URL tests, or personalisation campaigns you create
  • Goals — The conversion events you want to measure (page visits, clicks, form submissions, revenue, etc.)
  • Audiences — The targeting conditions that determine which visitors qualify for each experience

The script receives all of this configuration in a single bundled file, evaluates it on each page load, and reports results back to Convert's servers.