Skip to content

Visual Experiments (beta)

Latest

Choose a tag to compare

@jakewski jakewski released this 16 Nov 15:14
Immutable release. Only release title and notes can be modified.

This release adds the SDK runtime for Mixpanel's no-code visual experiments. This feature is off by default. To turn it on, set the flags and visual_experiments initialization options to true:

mixpanel.init('YOUR_TOKEN', {
  flags: true,
  visual_experiments: true,
});
  • Applying variants: the SDK automatically applies a variant's visual changes on the page it was authored for (matched by origin and pathname), including after SPA navigations, and re-applies them when the page re-renders.
  • Anti-flicker: the page is hidden while flags load and revealed once they arrive or the request fails. visual_experiments_hide_timeout_ms (default 2000) sets the longest the page can stay hidden.
  • Exposure tracking: the $experiment_started event is sent with $experiment_type: 'visual' the first time a variant actually changes the page, or as soon as the page matches for a control variant.
  • Shared preview links: a URL with the mp_preview_token query string param loads the previewed variant. Previews are never persisted or tracked as exposures, and session recording is skipped on preview pages.
  • Editor API: mixpanel.experiments is available when visual_experiments is enabled. The Mixpanel browser extension uses it for live preview while authoring.