Google Optimize Anti Flicker Code add to Head

Posted in: Newspaper
Post count: 257

Hi,

I want to use Google Optimize.
Everything works, but I have a problem at one point.
I need to insert the “anti-flicker code” as high up in the head of each page as possible.
What are the possibilities here?

The Code i have to add:
<!– Page hiding snippet (recommended) –>
<style>.async-hide { opacity: 0 !important} </style>
<script>
(function(a,s,y,n,c,h,i,d,e){s.className+=’ ‘+y;
h.end=i=function(){s.className=s.className.replace(RegExp(‘ ?’+y),”)};
(a[n]=a[n]||[]).hide=h;setTimeout(function(){i();h.end=null},c);
})(window,document.documentElement,’async-hide’,’dataLayer’,4000,{‘GTM-XXXXXX’:true});
</script>

Post count: 35449

Hi,

Usually this code should work if is set in theme panel> analytics/js code -> https://i.imgur.com/cBVSsBG.png

Let me know the results!

Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.