On this page
What this issue is
Most A/B testing and personalisation tools run in the visitor's browser. The page loads as the original, then the tool's JavaScript changes the headline, image or button for visitors in a variant. If the browser paints before the script runs, the visitor sees the original for a split second and then watches it change. This is often called flicker, or a flash of original content.
Why it costs you leads or sales
The business impact is usually low, but it is real. A visible swap looks unpolished and can make visitors distrust the page, especially on a headline, price or offer. It can also bias your test: if the variant causes a jolt that the original does not, you are measuring the flash as well as the idea. A visitor who sees the old offer and then a new one may also be confused about which one is true.
Example: the variant has a better message, but the visible swap cancels part of the gain. Numbers are illustrative only.
- Page requestBrowser starts loading HTML
- Original paintsVisitor sees the control headline
- Test script runsVariant changes are applied late
- Variant shownContent jumps to the new version
The break is the moment the original is painted before the test script runs.
How to check if your site has it
Flicker lasts a fraction of a second, so you will often miss it by eye. Use one of these approaches.
Force the variant
Use your testing tool's preview or QA link, or its cookie or URL parameter, to get the variant reliably.
Throttle the network
In Chrome DevTools open the Network tab and choose a Slow 4G profile. Slower loads make a late swap easier to see.
Record the load
In DevTools open the Performance panel and start a reload recording with screenshots enabled. Step through the first frames and look for the original content.
Test with a cold cache
Use a private window, since cached scripts can hide the problem on repeat visits.
Check mobile too
Phones are slower, so flicker is often worse there.
How to fix it
The cause is timing: the change arrives after the first paint. The fix is to apply it sooner, make it smaller, or apply it before the page is sent.
Load the test script early
Place it high in the head, before heavy CSS and other scripts, and load it synchronously if your tool recommends that. Do not load it through a tag manager if the tool advises a direct install, as that adds delay.
Hide only what changes
Hide just the element being tested until the variant is ready, rather than the whole page. Always add a timeout so the content shows even if the script fails.
Reduce the size of the change
Prefer CSS changes over large DOM rewrites, and test fewer elements per experiment.
Use server-side or edge testing for key pages
If your tool supports it, choose the variant before the HTML is sent so the right version arrives first.
Use your tool's own recommended snippet
Follow your vendor's current instructions, as the right approach differs by tool.
<style id="hide-hero">.hero-headline{opacity:0 !important}</style>
<script>
setTimeout(function () {
var s = document.getElementById('hide-hero');
if (s) s.remove();
}, 800);
</script>Add the script in the head
Use your theme's header hook or a header scripts plugin so the test script loads before other scripts, not in the footer.
Exclude it from deferral
If a caching or optimisation plugin delays or defers JavaScript, exclude the test script from that setting.
Place it in theme.liquid
Add the snippet near the top of the head in theme.liquid, above other scripts.
Check app embeds
If the tool is an app embed, confirm it is not loaded late by another app.
Use a tag that fires early
If you must load the tool through GTM, fire it on Consent Initialization or Initialization rather than on Page View or Window Loaded, where your consent setup allows it.
Prefer a direct install
For tests on the first screen, installing the snippet directly in the page head is faster.
Use head code
In Site settings, Custom code, add the snippet to Head code rather than Footer code.
Put it first in the head
Add the synchronous snippet before stylesheets and other scripts, and consider server-side variant selection.
How to confirm it's fixed
Repeat the same recording with the same throttling, cold cache and forced variant. In the first frames you should see only the variant, never the original. Check on desktop and a real phone, and on each page that carries the test.
Flicker
- Script loaded late or deferred
- Original headline visible for a moment
- Whole page or large blocks rewritten
Clean load
- Script early in the head
- Only the tested element briefly held back, with a timeout
- First paint already shows the variant
How to prevent it happening again
- Test the variant on Slow 4G with a cold cache
- Check desktop and mobile
- Confirm the test script is still in the head and not deferred by an optimisation plugin
- Keep changes small and scoped
- Keep a fallback timeout on any hiding rule
- Re-check after theme, plugin or tag manager changes
How FunnelGuard handles this
FunnelGuard does not check for A/B test flicker today. It is a possible future check, since it depends on screenshot timing in the first moments of a page load. What FunnelGuard does do is run your real customer journeys on a schedule and check each step, the tracking hits sent to ad and analytics platforms, and whether test leads reach your inbox and CRM. That can show you when a test variant breaks a form or drops tracking, but not that the original flashed first.
Questions people ask
Why does my A/B test show the original page before the variant?
Client-side testing tools change the page with JavaScript after it loads. If the browser paints the original before the script runs, visitors see the original for a moment and then the swap.
How do I stop A/B test flicker?
Load the test script early in the head, hide only the tested element briefly with a short timeout, keep changes small, or use server-side testing so the variant is in the HTML from the start.
Does flicker affect A/B test results?
It can. A visible swap may reduce trust or distract visitors in the variant only, so you may be measuring the flash as well as your idea. Fixing it makes results cleaner.
Is an anti-flicker snippet a good fix?
It can help, but it hides content until the script is ready, so it needs a short timeout. If the script fails, a poorly built snippet can leave the page blank, so scope it narrowly.
Does loading the test tool through Google Tag Manager cause flicker?
Often, yes. A tag manager adds a step before the test script runs, so the swap happens later. Fire the tag as early as your consent setup allows, or install the script directly in the head.
How can I see flicker if it only lasts a split second?
Throttle the network to Slow 4G in Chrome DevTools, reload with a cold cache and record the load in the Performance panel with screenshots. Step through the first frames to spot the original.
Does FunnelGuard detect A/B test flicker?
No. FunnelGuard does not check for flicker yet. It does run your customer journeys on a schedule and checks steps, tracking hits and lead delivery, which can reveal broken variants.
Related issues
- CNV-348Test tool script fails and hides page (anti-flicker snippet)Fix guide
- CNV-346A/B variant B has a broken formFix guide
- CNV-349Variant drops tracking tagsFix guide
- CNV-350Variant ends but traffic still splitFix guide
- CNV-351Personalised content shows wrong name/cityFix guide
- CNV-352Dynamic text replacement shows raw tokensFix guide