On this page
What this issue is
A/B test tools swap parts of your page after it loads. This can cause a flash of the original content before the variant appears. To hide that flash, many tools ask you to paste an anti-flicker snippet in the head of your page. It adds a CSS rule that makes the page invisible, for example opacity: 0 on the html element, and removes the rule once the test script has finished.
Why it costs you leads or sales
A hidden page cannot convert. Visitors who arrive from paid ads see a white or empty screen, or see the page but cannot read it, and they leave within seconds. Because the page technically loaded, many analytics tools still count a visit, so you see traffic with no conversions and no obvious error.
Even when the timeout works, a long one (some snippets use 4 seconds) delays what visitors see. That hurts perceived speed and Core Web Vitals such as Largest Contentful Paint (LCP), the time until the main content appears. Slow pages on mobile lose more visitors, and you pay for every ad click that lands on them.
- Ad clickVisitor lands on the page
- Hide rule addedSnippet sets the page to invisible
- Test script loadsBlocked, slow or errors out
- Page revealedNever happens or waits for the timeout
- Form or checkoutVisitor never sees it
The hide rule is added first and only the test script can remove it.
Example: illustrative numbers showing how a longer hide timeout can lose more visitors before they see anything.
How to check if your site has it
Look for the snippet in the source
Open the page, right-click and choose View page source. Search for terms such as async-hide, anti-flicker, opacity:0 or the name of your test tool. It is usually a small inline script in the head.
Block the test script on purpose
Open browser DevTools, go to the Network tab, right-click the test tool's script request and choose Block request URL (the wording varies by browser). Reload and see how long the page stays hidden.
Inspect the html element
In the Elements tab, check whether the html or body tag has a hide class or an inline style such as opacity: 0 or visibility: hidden after the page has loaded.
Test on a slow connection
In DevTools Network, set throttling to Slow 4G and reload. Note how long you see a blank page. Also try with an ad blocker on.
Check your speed report
Run PageSpeed Insights on the landing page. A high LCP, or a hidden element at capture time, points to the snippet.
The hide rule waits for a script that never arrives.
How to fix it
You have two choices. The safest is to remove the anti-flicker snippet and accept a small amount of flicker, or fix flicker in the test tool's own settings. If you need to keep it, add a short timeout so the page always appears, even if the tool fails.
<style>.fg-hide{opacity:0 !important}</style>
<script>
(function(){
var d=document.documentElement;
d.classList.add('fg-hide');
function show(){d.classList.remove('fg-hide');}
// Always reveal the page after 500 ms, whatever happens.
setTimeout(show,500);
// Your test tool should call this when it is ready.
window.revealPage=show;
})();
</script>Find the tag
In your container, open Tags and look for the test tool's tag or a Custom HTML tag containing the hide style.
Move or shorten it
Hide scripts must run early, so a GTM-loaded snippet often arrives too late. Prefer the tool's own head snippet. If you keep it in GTM, use the earliest trigger and shorten the timeout.
Preview and publish
Use Preview mode, confirm the page shows with the script blocked, then publish.
Find where it is added
Check the test tool's plugin settings, a header-and-footer plugin, and your theme's header.php.
Edit or remove the hide code
Lower the timeout or delete the snippet. Clear your cache plugin and CDN afterwards.
Open the theme code
Go to Online Store, Themes, Edit code and open theme.liquid. Search for the hide style or the tool name.
Shorten or remove it
Edit the timeout or delete the snippet, then save. Also check apps that inject scripts through the app embeds area in the theme editor.
Open custom code
Go to Site settings, Custom code, and check the Head code box. Also check page-level settings.
Edit and publish
Lower the timeout or remove the snippet, then publish the site.
Open custom code
In Settings, find Custom code, and open the entry for your test tool.
Adjust the snippet
Shorten the timeout or delete the entry, then apply.
Open code injection
Go to Settings, Developer Tools, Code Injection and check the Header field.
Edit and save
Lower the timeout or remove the snippet and save.
Find the inline script
Search your templates for the hide class or the tool name, usually in the head.
Add a fail-safe
Use the code above, or at least a setTimeout that always removes the hide rule.
Pause or end finished tests
Old tests keep the snippet active. If no test is running on the page, remove the snippet entirely.
Shorten the timeout
Set it to the lowest value your tool allows, ideally under one second.
Make sure the script loads reliably
Fix console errors, and check that your consent tool or ad blockers do not stop the test script while the hide rule still runs.
Use server-side or tool-native options
If your tool offers server-side variants or its own flicker setting, use that instead of a page-wide hide.
Before
- Hide rule has no timeout, or a long one
- Blocked test script leaves a blank page
- Ad clicks wasted, LCP high
After
- Page always shows within a short timeout
- Failed script means original page, not an empty one
- Form and buttons reachable on every visit
No timeout
Leads or data lost
The test script fails, the page stays invisible and visitors leave without seeing the form.
Toggle to see what a failed test script does to the visitor.
How to confirm it's fixed
- With the test script blocked in DevTools, the page appears within about a second
- No hide class or opacity: 0 remains on html or body after load
- With an ad blocker on, the page and form are visible
- The form submits and the button can be clicked
- PageSpeed Insights shows an LCP no worse than before the test
- Variants still show correctly when the script does load
How to prevent it happening again
- Remove the snippet when a test ends, do not just pause it
- Keep one owner and a change log for test tool code
- Always include a timeout in any hide rule
- Retest the page with the script blocked after each tool or theme update
- Do not load the hide snippet from a source that depends on consent unless the page works without it
- Run tests on a few pages at a time so a failure has a small reach
Week 1
A test is set up and the anti-flicker snippet is added to the head.
Week 3
The test ends and the tool account is closed, but the snippet stays.
Week 3 onward
The script no longer loads, so visitors wait for the timeout or see nothing.
Later
Snippet is found and removed or given a short timeout.
How FunnelGuard handles this
FunnelGuard detects this today. A robot visitor loads your landing page on a schedule, from the EU or the US, and measures how the page loads, including Core Web Vitals. It also checks whether your key buttons and form fields are visible and clickable, so a page stuck behind a hide rule or a covered call to action shows up as a failed step.
If a check fails, FunnelGuard re-checks it from a second region before sending one alert by email, Slack, Teams, WhatsApp, webhook or PagerDuty, with a screenshot and a likely cause. It cannot tell you which test tool is responsible with certainty, so use the screenshot and the steps above to confirm. The Free plan covers 1 site and 2 journeys with daily checks and no card, and paid plans have a 3-day free trial.
Questions people ask
Why is my page blank because of an A/B testing tool?
Your tool probably added an anti-flicker snippet that hides the page until its script loads. If the script is blocked, slow or broken, the hide rule is never removed. Add a short timeout or remove the snippet.
What is an anti-flicker snippet?
It is a small piece of code, usually in the page head, that makes the page invisible with CSS until an A/B test tool has applied its changes. It prevents visitors seeing the original content flash before the variant.
How do I remove the anti-flicker snippet?
Find it in your theme, tag manager or custom code settings by searching for the hide class or your test tool's name, then delete it and clear caches. Remove it only when no active test on the page relies on it.
How long should an anti-flicker timeout be?
As short as your tool allows, ideally under one second. The timeout is the longest a visitor will see nothing, so every extra second costs visitors and slows Largest Contentful Paint.
Does an anti-flicker snippet hurt Core Web Vitals?
It can. Hiding the page delays when content becomes visible, which can raise Largest Contentful Paint. A long timeout or a failed script makes it worse.
How can I test what happens if my A/B test script fails?
Open DevTools, go to the Network tab, block the test tool's script URL and reload. If the page stays hidden for more than a moment, you need a timeout or to remove the snippet.
Can I still use A/B testing without an anti-flicker snippet?
Yes. You can accept a small flicker, use your tool's server-side or built-in options, or test elements below the fold where flicker is less visible.
How can I be alerted if my page gets hidden?
A synthetic monitor such as FunnelGuard loads the page on a schedule, measures page load and checks that key buttons are visible, then alerts you with a screenshot if a check fails.
Related issues
- CNV-347Flicker of original content before variantFix 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