Anti-Flicker Script
Page flicker occurs when a web page briefly appears with the browser's default styles before loading an external CSS stylesheet and JS which re-renders it causing the restyled elements to momentarily 'jump' on the page.
The most effective way to mitigate page flicker when loading Optimize is to temporarily hide the page while the AB test loads. This is accomplished by adding the anti-flicker snippet as the first script on your page(s).
It is very important that the anti-flickering script is inserted in the <head> section
before FigPii's tracking code. The code should be inserted directly on the page and not by using Tag Managers.
<!-- FigPii Anti-Flicker Snippet --> <style>.fp-hide{opacity:0!important;}</style> <script>(function(w,h,c,v,t,a,o){h.className+=" "+c;o=w[v]=w[v]||[];o.show=a=function(){h.className=h.className.replace(RegExp(" ?"+c),"")};setTimeout(function(){a();o.show=null},t)})(window,document.documentElement,"fp-hide","_fpHide",4500);</script> <!-- End FigPii Anti-Flicker Snippet -->