Support » Plugin: Google Tag Manager for WordPress » Google Optimize + Plugin Setup

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    Currently the best possible approach to install Google Optimize on your site is to add the truncated GA tracking code into your <head> section manually (the one that does not include a send..pageview command).

    This will ensure that the Optimize snippet loads as early as possible delivering the best user experience.

    The message in my plugin is a false positive line that has been already removed in the dev version of the plugin. Please ignore it.

    @duracelltomi

    Hi,

    Could you explain about “truncated GA tracking code” more detail?

    <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-XXXXXX-11’, ‘auto’);
    ga(‘send’, ‘pageview’);
    ga(‘require’, ‘GTM-xxxxx’);
    </script>

    Can I put all the rest of the code in <Head> after deleting ” ga(‘send’, ‘pageview’);” line?

    Do not need to add page hiding snippet manually ?
    Do not need to add gtm ID in Google Tag Manager for WordPress options?

    Thank you.

    • This reply was modified 2 years, 8 months ago by cheonmu.
    • This reply was modified 2 years, 8 months ago by cheonmu.
    • This reply was modified 2 years, 8 months ago by cheonmu.
    Plugin Author Thomas Geiger

    (@duracelltomi)

    Yes, you can put the code into the <head> part of your page without the send..pageview line. This will load your Optimize container and do the necessary changes on your site if there is an A/B test working.

    The page hiding snippet can be added by my plugin or manually, as you wish.

    GTM ID has to be added in my plugin but on the Optimize integration page you only need to enter the Optimize container code ID if you wish to add the page hiding snippet by my plugin.

    +1 for remove the “This plugin is not active, enabling this integration could cause issues on frontend!” on the Optimize tab.

    That is very confusing. I searched for 20 minutes trying to figure out what plugin was missing. I had to read the code to finally determine I was not missing another plugin.

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Thanks, this line has been removed from the next version of the plugin. You can test v1.8 beta by downloading from here:
    https://github.com/duracelltomi/gtm4wp/releases/tag/1.8beta1

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Google Optimize + Plugin Setup’ is closed to new replies.