The window.convert Object

Overview

Once the tracking script loads, it exposes a global window.convert object with useful properties and methods. You can use these in your Global JavaScript, Variation JavaScript, or browser console for debugging.

Methods

Cookie Access

MethodDescriptionReturns
convert.getCookie(name)Read any cookie by namestring or null
convert.setCookie(name, value, expire?)Write a cookie (expire in seconds)

Visitor Data

MethodDescriptionReturns
convert.getUserData()Get visitor geolocation data{ geo: { country, city, state, continent } }
convert.getDefaultSegments()Get auto-generated segments{ browser, devices, source, campaign, visitorType, country }
convert.getVisitorSegments()Get all segments (default + custom)Same as above plus customSegments: [ids]

Navigation

MethodDescription
convert.redirect(url)Navigate to a URL (for split URL variations)
convert.refresh()Reload the current page (for split URL originals)
convert.showBody()Force-remove the anti-flicker overlay

Logging

MethodDescription
convert.sendLog(log, from)Send a custom log entry to Convert's servers

Properties

convert.currentData

Contains the visitor's current bucketing state — which experiences they're in and which variations they see.

// Example
convert.currentData.experiences
// {
//   "10012345": {
//     variation: { id: "10012346", name: "Red Button" }
//   }
// }

convert.historicalData

Contains the visitor's full history of experience participation across sessions.

convert.data

The active configuration data including device detection, geo data, and feature flags.

convert.data.device    // { mobile: false, tablet: false, desktop: true }
convert.data.geo       // { country: "US", city: "DALLAS", state: "TX" }

Query Parameters

The tracking script responds to several URL query parameters for debugging and testing:

Debugging

ParameterEffect
convert_log_level=infoShow info-level logs in browser console
convert_log_level=debugShow detailed debug logs in browser console
convert_disable=trueDisable the tracking script entirely
_conv_prevent_tracking=trueRun experiences but don't send tracking events

Preview & Force

ParameterEffect
convert_action=convert_vpreviewEnter preview mode (no tracking, skip targeting)
convert_v={variationId}Preview a specific variation
convert_e={experienceId}Preview a specific experience
_conv_eforce={expId}.{varId}Force a specific variation (comma-separated for multiple)

Script Control

ParameterEffect
convert_dom_timeout=2500Set the anti-flicker timeout in milliseconds
_conv_disable_spa_optimizations=trueDisable SPA URL change detection
_conv_disable_signals=trueDisable the Signals bundle

Global Variables

VariablePurpose
window._conv_qCommand queue (see JavaScript API)
window._conv_prevent_bodyhideSet to true before the script loads to prevent the anti-flicker overlay