• Resolved Frenkie

    (@frano09)


    Hi there, is there a way to integrate the plugin with google optimize (here you have to add some simple code to the analytics snippet), see the code below.

    Would be great if you could integrate this, hope to hear, thanks in advance!

    =======================

    Add Optimize to your website
    Optimize is installed on your site by adding a single line of code (shown in bold) to your existing Universal Analytics (analytics.js) tracking code. If you don’t have Google Analytics or if you’re using Google Tag Manager, please refer to the Optimize help center.
    To install Optimize, do the following on each page you want to test:
    Ensure that your Analytics tracking code is as high as possible in the <HEAD> of every page.
    Add the line in bold below to your tracking code.
    <script>
    (function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,’script’,’https://www.google-analytics.com/analytics.js&#8217;,’ga’);
    ga(‘create’, ‘UA-xxxx-1’, ‘auto’);
    ga(‘require’, ‘GTM-MT26PR6’);
    ga(‘send’, ‘pageview’);
    </script>

    • This topic was modified 7 years, 8 months ago by Frenkie.
Viewing 1 replies (of 1 total)
  • Thread Starter Frenkie

    (@frano09)

    Additional information:

    Recommended: Page hiding
    When experiment variants are applied, users may very briefly see the original content. To minimize this, use the following snippet, which prevents users from seeing your page before a variant is applied, or times out on slower connections. Learn more about page hiding.
    To install page hiding:
    Copy the full code below and add it to every page with Optimize as early in the <HEAD> as possible.
    Ensure that your updated Google Analytics tracking code immediately follows your hiding code.
    <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-MT26PR6’:true});</script>
    Learn more about other ways to deploy Optimize, including serving it with Google Tag Manager, in the Optimize help center.

Viewing 1 replies (of 1 total)
  • The topic ‘Integration for Google Optimize’ is closed to new replies.