Support » Plugin: Autoptimize » Autoptimize breaks Google Optimize

  • Resolved ingeklikt


    I recently implemented Google Optimize in the header.php of my website following the steps on the Lunametrics website.

    Unfortunately, Google Optimize didn’t work. I discovered that it does work when Autoptimize is turned off. Is there a way to exclude the Google Optimize code from Autoptimize?

    This is the code that is written in the header.php file:

    <!-- 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.start=1*new Date;
    h.end=i=function(){s.className=s.className.replace(RegExp(' ?'+y),'')};
    <!-- end Optimize Page Hiding Snippet -->
    <!-- Analytics-Optimize Snippet -->
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      ga('create', 'UA-XXXXXX', 'auto');
      ga('require', 'GTM-XXXXXX');
    <!-- end Analytics-Optimize Snippet -->

    I’d love to know if there is a solution since I really want to use both, thanks ๐Ÿ™‚

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Autoptimize breaks Google Optimize’ is closed to new replies.