page is

  1. <script>
  2. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  3. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  4. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  5. })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  6. ga('create', 'UA-98621016-2', 'auto');
  7. ga('require', 'GTM-WXLV4H4');
  8. ga('send', 'pageview');
  9. </script>

Step 2: Minimize page flickering

This snippet ensures that users only see your variant content, minimizing page flicker. Learn more

  1. Copy the code below
  2. <style>.async-hide { opacity: 0 !important} </style>
  3. <script>(function(a,s,y,n,c,h,i,d,e){s.className+=' '+y;h.start=1*new Date;
  4. h.end=i=function(){s.className=s.className.replace(RegExp(' ?'+y),'')};
  5. (a[n]=a[n]||[]).hide=h;setTimeout(function(){i();h.end=null},c);h.timeout=c;
  6. })(window,document.documentElement,'async-hide','dataLayer',4000,
  7. {'GTM-WXLV4H4':true});</script>
  8. Paste it just before your updated Analytics tracking code anywhere you want to use Optimize.


<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',4000,
{'GTM-WXLV4H4':true});</script>