I cannot seem to resolve the warning message of the anti-flicker snippet from Google Optimize timing out.
The snippet is installed at the top of the <head> tag before the gtag optimize JS code.
I have tried changing the timeout value up to 6000, still not working.
<style>.async-hide { opacity: 0 !important} </style>
<script>(function(a,s,y,n,c,h,i,d,e){s.className+=' '+y;h.start=1*new Date;
h.end=i=function(){s.className=s.className.replace(RegExp(' ?'+y),'')};
(a[n]=a[n]||[]).hide=h;setTimeout(function(){i();h.end=null},c);h.timeout=c;
})(window,document.documentElement,'async-hide','dataLayer',2000,
{'OPT_CONTAINER_ID':true});</script>
I'm still getting the following error message:
The anti-flicker snippet might not have been configured correctly or the timeout value is too short. The anti-flicker timeout is a worst-case scenario. Your page will only be hidden for the full timeout if the experiment cannot execute sooner (and when it does, the page is unhidden immediately). When anti-flicker times out, your experiment doesn't run on that page load, which can limit the efficacy of your experiment and results. Regardless of timeout value, ensure that the Optimize plugin is deployed correctly and not late in the page (e.g. in the ).