From 0d61704a2a783b5b40be8de0c0d2e878c7881ca8 Mon Sep 17 00:00:00 2001 From: ComfyUI Wiki Date: Wed, 26 Aug 2026 10:15:37 +0800 Subject: [PATCH 1/4] docs: add PostHog A/B test hook for nav CTA copy --- nav-cta-ab-test.js | 143 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 nav-cta-ab-test.js diff --git a/nav-cta-ab-test.js b/nav-cta-ab-test.js new file mode 100644 index 000000000..15bcb0287 --- /dev/null +++ b/nav-cta-ab-test.js @@ -0,0 +1,143 @@ +// PostHog A/B test for the docs navbar CTA copy. +// +// The navbar CTA ("Comfy Cloud" -> https://comfy.org/cloud?utm_source=docs) +// is rendered by the docs platform from docs.json, so variant assignment +// happens here in a small JS hook that reads the PostHog flag. Mintlify +// inlines every root-level .js file on all pages, so this runs site-wide. +// +// Flag: docs_nav_cta_copy_v1 (string flag) +// - "try_cloud_free" -> label becomes "Try Cloud Free" (homepage-style copy) +// - "control" -> keep "Comfy Cloud" (the docs.json default) +// - unset/undefined -> "Comfy Cloud" (control) +// +// The href is intentionally unchanged in both variants. Clicks to +// comfy.org/cloud already convert well (27% of clickers sign up); the test +// isolates the copy, not the destination. +// +// Exposure: calling posthog.getFeatureFlag() automatically captures the +// $feature_flag_called event (deduplicated per session), carrying the flag +// key and the assigned response. Clicks are captured explicitly as +// "docs_nav_cta_clicked" with the assigned variant so the test can be +// analyzed against docs-attributed signups in PostHog. + +(function () { + "use strict"; + + var FLAG_KEY = "docs_nav_cta_copy_v1"; + var CTA_HREF = "https://comfy.org/cloud?utm_source=docs"; + var VARIANTS = { + control: { label: "Comfy Cloud" }, + try_cloud_free: { label: "Try Cloud Free" } + }; + // Labels we are allowed to swap, so re-renders and flag flips stay idempotent. + var KNOWN_LABELS = ["Comfy Cloud", "Try Cloud Free"]; + var assignedVariant = "control"; + + function variantLabel(variant) { + return (VARIANTS[variant] || VARIANTS.control).label; + } + + // Swap the label on every CTA link (desktop button, mobile nav link, and + // any future duplicate). Returns true when at least one label was updated. + function applyLabel(label) { + var links = document.querySelectorAll('a[href="' + CTA_HREF + '"]'); + var changed = false; + for (var i = 0; i < links.length; i++) { + var spans = links[i].querySelectorAll("span"); + for (var j = 0; j < spans.length; j++) { + var text = (spans[j].textContent || "").trim(); + if (KNOWN_LABELS.indexOf(text) !== -1) { + spans[j].textContent = label; + changed = true; + break; + } + } + } + return changed; + } + + function applyVariant() { + var variant = "control"; + try { + if (window.posthog) { + var raw = window.posthog.getFeatureFlag(FLAG_KEY); + if (raw === "control" || raw === "try_cloud_free") { + variant = raw; + } + } + } catch (e) { + // PostHog not ready or flag lookup failed: keep the control copy. + } + assignedVariant = variant; + applyLabel(variantLabel(variant)); + } + + // The navbar can re-render on navigation (Mintlify is a Next.js SPA). + // Re-apply the variant whenever the CTA link appears or changes, debounced. + var observer = null; + var scheduled = false; + function watchNav() { + if (observer || typeof MutationObserver === "undefined") return; + observer = new MutationObserver(function () { + if (scheduled) return; + scheduled = true; + setTimeout(function () { + scheduled = false; + applyVariant(); + }, 200); + }); + observer.observe(document.body, { childList: true, subtree: true }); + } + + function init() { + if (window.posthog && window.posthog.onFeatureFlags) { + window.posthog.onFeatureFlags(function () { + applyVariant(); + watchNav(); + }); + return; + } + // PostHog loads async via the docs platform integration. Poll briefly so + // the hook still runs if it arrives late, then fall back to control. + var tries = 0; + var timer = setInterval(function () { + tries += 1; + if (window.posthog && window.posthog.onFeatureFlags) { + clearInterval(timer); + window.posthog.onFeatureFlags(function () { + applyVariant(); + watchNav(); + }); + } else if (tries >= 100) { + clearInterval(timer); + applyVariant(); + watchNav(); + } + }, 100); + } + + // Record CTA clicks with the assigned variant for funnel analysis. + document.addEventListener( + "click", + function (event) { + if (!window.posthog) return; + var target = + event.target instanceof Element + ? event.target.closest('a[href="' + CTA_HREF + '"]') + : null; + if (!target) return; + window.posthog.capture("docs_nav_cta_clicked", { + variant: assignedVariant, + label: variantLabel(assignedVariant), + href: target.href + }); + }, + true + ); + + if (document.readyState === "loading") { + document.addEventListener("DOMContentLoaded", init); + } else { + init(); + } +})(); From 5e6f4a91ba4f5b5f0f8d268e0d022326a0c980e8 Mon Sep 17 00:00:00 2001 From: ComfyUI Wiki Date: Wed, 26 Aug 2026 10:32:15 +0800 Subject: [PATCH 2/4] docs: align CTA A/B hook with PostHog flag docs-cta-copy (variant test) --- nav-cta-ab-test.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/nav-cta-ab-test.js b/nav-cta-ab-test.js index 15bcb0287..dc6549bc3 100644 --- a/nav-cta-ab-test.js +++ b/nav-cta-ab-test.js @@ -5,10 +5,10 @@ // happens here in a small JS hook that reads the PostHog flag. Mintlify // inlines every root-level .js file on all pages, so this runs site-wide. // -// Flag: docs_nav_cta_copy_v1 (string flag) -// - "try_cloud_free" -> label becomes "Try Cloud Free" (homepage-style copy) -// - "control" -> keep "Comfy Cloud" (the docs.json default) -// - unset/undefined -> "Comfy Cloud" (control) +// Flag: docs-cta-copy (string flag, experiment #448700 "Docs CTA copy") +// - "test" -> label becomes "Try Cloud for free" (homepage-style copy) +// - "control" -> keep "Comfy Cloud" (the docs.json default) +// - unset -> "Comfy Cloud" (control) // // The href is intentionally unchanged in both variants. Clicks to // comfy.org/cloud already convert well (27% of clickers sign up); the test @@ -23,14 +23,14 @@ (function () { "use strict"; - var FLAG_KEY = "docs_nav_cta_copy_v1"; + var FLAG_KEY = "docs-cta-copy"; var CTA_HREF = "https://comfy.org/cloud?utm_source=docs"; var VARIANTS = { control: { label: "Comfy Cloud" }, - try_cloud_free: { label: "Try Cloud Free" } + test: { label: "Try Cloud for free" } }; // Labels we are allowed to swap, so re-renders and flag flips stay idempotent. - var KNOWN_LABELS = ["Comfy Cloud", "Try Cloud Free"]; + var KNOWN_LABELS = ["Comfy Cloud", "Try Cloud for free"]; var assignedVariant = "control"; function variantLabel(variant) { @@ -61,7 +61,7 @@ try { if (window.posthog) { var raw = window.posthog.getFeatureFlag(FLAG_KEY); - if (raw === "control" || raw === "try_cloud_free") { + if (raw === "control" || raw === "test") { variant = raw; } } From d8d0951b5c94c71adc068c509f690365ac8b3339 Mon Sep 17 00:00:00 2001 From: ComfyUI Wiki Date: Wed, 26 Aug 2026 10:43:09 +0800 Subject: [PATCH 3/4] docs: evaluate CTA flag via dedicated posthog-js instance (bypass Mintlify proxy) --- nav-cta-ab-test.js | 148 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 127 insertions(+), 21 deletions(-) diff --git a/nav-cta-ab-test.js b/nav-cta-ab-test.js index dc6549bc3..f2db6db0b 100644 --- a/nav-cta-ab-test.js +++ b/nav-cta-ab-test.js @@ -10,11 +10,24 @@ // - "control" -> keep "Comfy Cloud" (the docs.json default) // - unset -> "Comfy Cloud" (control) // +// Flag plumbing: docs.comfy.org's PostHog runs through Mintlify's proxy +// (api_host = https://ph.mintlify.com) and docs has never evaluated a +// feature flag, so the proxy's flags endpoint is unverified. If the proxy +// does not forward flag evaluations, getFeatureFlag() returns undefined and +// the experiment would silently record 100% control. To remove that failure +// mode, this hook creates its own posthog-js instance +// (window.posthog.docsCta, via the named-instance init) pointed directly at +// PostHog's ingestion host, with autocapture/pageviews disabled so nothing +// is double-counted, and its distinct_id synced to the main instance so +// exposure and click events attach to the same person as the pageviews and +// docs.navitem.cta_click events. It only falls back to Mintlify's proxied +// instance if the dedicated one cannot be created. +// // The href is intentionally unchanged in both variants. Clicks to // comfy.org/cloud already convert well (27% of clickers sign up); the test // isolates the copy, not the destination. // -// Exposure: calling posthog.getFeatureFlag() automatically captures the +// Exposure: calling getFeatureFlag() automatically captures the // $feature_flag_called event (deduplicated per session), carrying the flag // key and the assigned response. Clicks are captured explicitly as // "docs_nav_cta_clicked" with the assigned variant so the test can be @@ -24,6 +37,11 @@ "use strict"; var FLAG_KEY = "docs-cta-copy"; + // Direct PostHog ingestion host, bypassing Mintlify's ph.mintlify.com proxy. + var INGESTION_HOST = "https://us.i.posthog.com"; + var INSTANCE_NAME = "docsCta"; + // Public client key, same value as docs.json -> integrations.posthog.apiKey. + var FALLBACK_TOKEN = "phc_iKfK86id4xVYws9LybMje0h44eGtfwFgRPIBehmy8rO"; var CTA_HREF = "https://comfy.org/cloud?utm_source=docs"; var VARIANTS = { control: { label: "Comfy Cloud" }, @@ -32,11 +50,42 @@ // Labels we are allowed to swap, so re-renders and flag flips stay idempotent. var KNOWN_LABELS = ["Comfy Cloud", "Try Cloud for free"]; var assignedVariant = "control"; + var flagMachineReady = false; + var safetyTimer = null; + + function mainPh() { + return window.posthog || null; + } + + function dedicatedPh() { + var m = mainPh(); + return m && m[INSTANCE_NAME] ? m[INSTANCE_NAME] : null; + } + + // The instance used to evaluate flags and capture events. + function activePh() { + return dedicatedPh() || mainPh(); + } function variantLabel(variant) { return (VARIANTS[variant] || VARIANTS.control).label; } + // Keep the dedicated instance's distinct_id in sync with the main + // (Mintlify) instance so exposure and click events land on the same person + // as the pageviews and docs.navitem.cta_click events. No-op once synced. + function ensureIdentity(ph) { + if (!ph || !ph.identify || !ph.get_distinct_id) return; + try { + var main = mainPh(); + var mainId = main && main.get_distinct_id ? main.get_distinct_id() : ""; + var ownId = ph.get_distinct_id() || ""; + if (mainId && ownId !== mainId) ph.identify(mainId); + } catch (e) { + // Identity sync is best-effort; the experiment still records. + } + } + // Swap the label on every CTA link (desktop button, mobile nav link, and // any future duplicate). Returns true when at least one label was updated. function applyLabel(label) { @@ -58,15 +107,16 @@ function applyVariant() { var variant = "control"; + var ph = activePh(); try { - if (window.posthog) { - var raw = window.posthog.getFeatureFlag(FLAG_KEY); + if (ph && ph.getFeatureFlag) { + var raw = ph.getFeatureFlag(FLAG_KEY); if (raw === "control" || raw === "test") { variant = raw; } } } catch (e) { - // PostHog not ready or flag lookup failed: keep the control copy. + // Flag lookup failed: keep the control copy. } assignedVariant = variant; applyLabel(variantLabel(variant)); @@ -89,12 +139,70 @@ observer.observe(document.body, { childList: true, subtree: true }); } - function init() { - if (window.posthog && window.posthog.onFeatureFlags) { - window.posthog.onFeatureFlags(function () { - applyVariant(); - watchNav(); - }); + // Called whenever a flag-capable instance becomes available. Idempotent; + // re-applies the variant each time so a late-arriving instance corrects an + // early control fallback. + function onFlagMachineReady(ph) { + if (safetyTimer) { + clearTimeout(safetyTimer); + safetyTimer = null; + } + ensureIdentity(ph); + applyVariant(); + if (!flagMachineReady) { + flagMachineReady = true; + watchNav(); + } + } + + // Create the dedicated posthog-js instance pointed at the direct ingestion + // host. Returns true when it was created; its loaded callback then drives + // onFlagMachineReady. + function initDedicated() { + var m = mainPh(); + if (!m || !m.init || dedicatedPh()) return false; + try { + var token = (m.config && m.config.token) || FALLBACK_TOKEN; + m.init( + token, + { + api_host: INGESTION_HOST, + autocapture: false, + capture_pageview: false, + capture_pageleave: false, + disable_session_recording: true, + disable_surveys: true, + loaded: function (ph) { + ensureIdentity(ph); + onFlagMachineReady(ph); + } + }, + INSTANCE_NAME + ); + return !!m[INSTANCE_NAME]; + } catch (e) { + return false; + } + } + + function start() { + var m = mainPh(); + if (m && m.config) { + // Main instance is already initialized. + if (!initDedicated()) { + // Fallback: evaluate flags through the main (Mintlify) instance. + if (m.onFeatureFlags) { + m.onFeatureFlags(function () { + onFlagMachineReady(m); + }); + } else { + onFlagMachineReady(m); + } + } + // Safety net: never hang on a stub that does not load. + safetyTimer = setTimeout(function () { + onFlagMachineReady(m); + }, 6000); return; } // PostHog loads async via the docs platform integration. Poll briefly so @@ -102,16 +210,12 @@ var tries = 0; var timer = setInterval(function () { tries += 1; - if (window.posthog && window.posthog.onFeatureFlags) { + if (mainPh() && mainPh().config) { clearInterval(timer); - window.posthog.onFeatureFlags(function () { - applyVariant(); - watchNav(); - }); + start(); } else if (tries >= 100) { clearInterval(timer); - applyVariant(); - watchNav(); + onFlagMachineReady(null); } }, 100); } @@ -120,13 +224,15 @@ document.addEventListener( "click", function (event) { - if (!window.posthog) return; + var ph = activePh(); + if (!ph || !ph.capture) return; var target = event.target instanceof Element ? event.target.closest('a[href="' + CTA_HREF + '"]') : null; if (!target) return; - window.posthog.capture("docs_nav_cta_clicked", { + ensureIdentity(ph); + ph.capture("docs_nav_cta_clicked", { variant: assignedVariant, label: variantLabel(assignedVariant), href: target.href @@ -136,8 +242,8 @@ ); if (document.readyState === "loading") { - document.addEventListener("DOMContentLoaded", init); + document.addEventListener("DOMContentLoaded", start); } else { - init(); + start(); } })(); From 30a1782b657175bb7a5a283fce7f6c9c73ac36d3 Mon Sep 17 00:00:00 2001 From: ComfyUI Wiki Date: Wed, 26 Aug 2026 12:18:06 +0800 Subject: [PATCH 4/4] docs: simplify CTA A/B hook to self-contained random variant assignment --- nav-cta-ab-test.js | 197 ++++++++++++--------------------------------- 1 file changed, 50 insertions(+), 147 deletions(-) diff --git a/nav-cta-ab-test.js b/nav-cta-ab-test.js index f2db6db0b..aed1e005b 100644 --- a/nav-cta-ab-test.js +++ b/nav-cta-ab-test.js @@ -1,89 +1,60 @@ // PostHog A/B test for the docs navbar CTA copy. // -// The navbar CTA ("Comfy Cloud" -> https://comfy.org/cloud?utm_source=docs) -// is rendered by the docs platform from docs.json, so variant assignment -// happens here in a small JS hook that reads the PostHog flag. Mintlify -// inlines every root-level .js file on all pages, so this runs site-wide. +// Self-contained variant assignment (no PostHog feature flag): each visitor +// is randomly assigned control ("Comfy Cloud") or test ("Try Cloud for free") +// with a 50/50 split. The assignment is kept stable per browser via +// localStorage, so the label does not flip between page loads, and every CTA +// click is captured as a PostHog event for per-variant analysis. // -// Flag: docs-cta-copy (string flag, experiment #448700 "Docs CTA copy") -// - "test" -> label becomes "Try Cloud for free" (homepage-style copy) -// - "control" -> keep "Comfy Cloud" (the docs.json default) -// - unset -> "Comfy Cloud" (control) +// Analysis events: +// - docs_nav_cta_exposure {variant, label} captured once per page load +// - docs_nav_cta_clicked {variant, label, href} // -// Flag plumbing: docs.comfy.org's PostHog runs through Mintlify's proxy -// (api_host = https://ph.mintlify.com) and docs has never evaluated a -// feature flag, so the proxy's flags endpoint is unverified. If the proxy -// does not forward flag evaluations, getFeatureFlag() returns undefined and -// the experiment would silently record 100% control. To remove that failure -// mode, this hook creates its own posthog-js instance -// (window.posthog.docsCta, via the named-instance init) pointed directly at -// PostHog's ingestion host, with autocapture/pageviews disabled so nothing -// is double-counted, and its distinct_id synced to the main instance so -// exposure and click events attach to the same person as the pageviews and -// docs.navitem.cta_click events. It only falls back to Mintlify's proxied -// instance if the dedicated one cannot be created. -// -// The href is intentionally unchanged in both variants. Clicks to +// The href is intentionally identical in both variants. Clicks to // comfy.org/cloud already convert well (27% of clickers sign up); the test // isolates the copy, not the destination. // -// Exposure: calling getFeatureFlag() automatically captures the -// $feature_flag_called event (deduplicated per session), carrying the flag -// key and the assigned response. Clicks are captured explicitly as -// "docs_nav_cta_clicked" with the assigned variant so the test can be -// analyzed against docs-attributed signups in PostHog. +// This deliberately does NOT use a PostHog feature flag / experiment. +// docs.comfy.org evaluates flags through Mintlify's proxy (an unverified +// path), and the test is small and self-contained. Trade-off: no PostHog +// experiment readout (significance testing, guardrails) or dashboard kill +// switch; analysis is manual, filtering the events above by variant. See the +// #website-and-docs Slack thread for the discussion. (function () { "use strict"; - var FLAG_KEY = "docs-cta-copy"; - // Direct PostHog ingestion host, bypassing Mintlify's ph.mintlify.com proxy. - var INGESTION_HOST = "https://us.i.posthog.com"; - var INSTANCE_NAME = "docsCta"; - // Public client key, same value as docs.json -> integrations.posthog.apiKey. - var FALLBACK_TOKEN = "phc_iKfK86id4xVYws9LybMje0h44eGtfwFgRPIBehmy8rO"; + var STORAGE_KEY = "docs_nav_cta_variant"; var CTA_HREF = "https://comfy.org/cloud?utm_source=docs"; var VARIANTS = { control: { label: "Comfy Cloud" }, test: { label: "Try Cloud for free" } }; - // Labels we are allowed to swap, so re-renders and flag flips stay idempotent. + // Labels we are allowed to swap, so re-renders and storage flips stay idempotent. var KNOWN_LABELS = ["Comfy Cloud", "Try Cloud for free"]; var assignedVariant = "control"; - var flagMachineReady = false; - var safetyTimer = null; - - function mainPh() { - return window.posthog || null; - } - - function dedicatedPh() { - var m = mainPh(); - return m && m[INSTANCE_NAME] ? m[INSTANCE_NAME] : null; - } - - // The instance used to evaluate flags and capture events. - function activePh() { - return dedicatedPh() || mainPh(); - } function variantLabel(variant) { return (VARIANTS[variant] || VARIANTS.control).label; } - // Keep the dedicated instance's distinct_id in sync with the main - // (Mintlify) instance so exposure and click events land on the same person - // as the pageviews and docs.navitem.cta_click events. No-op once synced. - function ensureIdentity(ph) { - if (!ph || !ph.identify || !ph.get_distinct_id) return; + // Assign the variant once per browser (sticky), falling back to a fresh + // random draw when storage is unavailable. + function assignVariant() { + var stored = null; try { - var main = mainPh(); - var mainId = main && main.get_distinct_id ? main.get_distinct_id() : ""; - var ownId = ph.get_distinct_id() || ""; - if (mainId && ownId !== mainId) ph.identify(mainId); + stored = window.localStorage.getItem(STORAGE_KEY); } catch (e) { - // Identity sync is best-effort; the experiment still records. + // Storage blocked (private mode): fall through to a random draw. } + if (stored === "control" || stored === "test") return stored; + var variant = Math.random() > 0.5 ? "test" : "control"; + try { + window.localStorage.setItem(STORAGE_KEY, variant); + } catch (e) { + // Best-effort; the draw still applies for this page load. + } + return variant; } // Swap the label on every CTA link (desktop button, mobile nav link, and @@ -106,20 +77,8 @@ } function applyVariant() { - var variant = "control"; - var ph = activePh(); - try { - if (ph && ph.getFeatureFlag) { - var raw = ph.getFeatureFlag(FLAG_KEY); - if (raw === "control" || raw === "test") { - variant = raw; - } - } - } catch (e) { - // Flag lookup failed: keep the control copy. - } - assignedVariant = variant; - applyLabel(variantLabel(variant)); + assignedVariant = assignVariant(); + applyLabel(variantLabel(assignedVariant)); } // The navbar can re-render on navigation (Mintlify is a Next.js SPA). @@ -139,83 +98,28 @@ observer.observe(document.body, { childList: true, subtree: true }); } - // Called whenever a flag-capable instance becomes available. Idempotent; - // re-applies the variant each time so a late-arriving instance corrects an - // early control fallback. - function onFlagMachineReady(ph) { - if (safetyTimer) { - clearTimeout(safetyTimer); - safetyTimer = null; - } - ensureIdentity(ph); - applyVariant(); - if (!flagMachineReady) { - flagMachineReady = true; - watchNav(); - } - } - - // Create the dedicated posthog-js instance pointed at the direct ingestion - // host. Returns true when it was created; its loaded callback then drives - // onFlagMachineReady. - function initDedicated() { - var m = mainPh(); - if (!m || !m.init || dedicatedPh()) return false; - try { - var token = (m.config && m.config.token) || FALLBACK_TOKEN; - m.init( - token, - { - api_host: INGESTION_HOST, - autocapture: false, - capture_pageview: false, - capture_pageleave: false, - disable_session_recording: true, - disable_surveys: true, - loaded: function (ph) { - ensureIdentity(ph); - onFlagMachineReady(ph); - } - }, - INSTANCE_NAME - ); - return !!m[INSTANCE_NAME]; - } catch (e) { - return false; - } + // PostHog loads async via the docs platform integration; capture the + // exposure once it is available (poll briefly, then give up silently). + function captureExposure() { + var ph = window.posthog; + if (!ph || !ph.capture) return; + ph.capture("docs_nav_cta_exposure", { + variant: assignedVariant, + label: variantLabel(assignedVariant) + }); } - function start() { - var m = mainPh(); - if (m && m.config) { - // Main instance is already initialized. - if (!initDedicated()) { - // Fallback: evaluate flags through the main (Mintlify) instance. - if (m.onFeatureFlags) { - m.onFeatureFlags(function () { - onFlagMachineReady(m); - }); - } else { - onFlagMachineReady(m); - } - } - // Safety net: never hang on a stub that does not load. - safetyTimer = setTimeout(function () { - onFlagMachineReady(m); - }, 6000); - return; - } - // PostHog loads async via the docs platform integration. Poll briefly so - // the hook still runs if it arrives late, then fall back to control. + function init() { + applyVariant(); + watchNav(); var tries = 0; var timer = setInterval(function () { tries += 1; - if (mainPh() && mainPh().config) { + if (window.posthog && window.posthog.capture) { clearInterval(timer); - start(); + captureExposure(); } else if (tries >= 100) { clearInterval(timer); - onFlagMachineReady(null); } }, 100); } @@ -224,14 +128,13 @@ document.addEventListener( "click", function (event) { - var ph = activePh(); + var ph = window.posthog; if (!ph || !ph.capture) return; var target = event.target instanceof Element ? event.target.closest('a[href="' + CTA_HREF + '"]') : null; if (!target) return; - ensureIdentity(ph); ph.capture("docs_nav_cta_clicked", { variant: assignedVariant, label: variantLabel(assignedVariant), @@ -242,8 +145,8 @@ ); if (document.readyState === "loading") { - document.addEventListener("DOMContentLoaded", start); + document.addEventListener("DOMContentLoaded", init); } else { - start(); + init(); } })();