How does the analytics id need to be added

Will this plugin still work if the Google Analytics code is being added through Google Tag Manager? It's been about 24 hours and I haven't seen the custom segments show up on the analytics site yet. Is there a way to manually input the Google Analytics Id into this plugin?

  • Jude

    Hi @Matt

    Hope you are doing great !!

    1) Yes it should work Google Tag Manager.
    2) The analytics code must be inserted into the themes you are AB Testing on. Alternately you can use a third party plugin to do this.

    Here is how I add the code on my sites.

    function GA_tracking_code () {
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      ga('create', 'UA-XXXXXX-2', 'auto');
      ga('send', 'pageview');
    add_filter( 'wp_footer', 'GA_tracking_code' );

    Just copy/paste the code into the functions.php file of your child theme or a site specific plugin if you use one. Also replace the code with your own tracking ID.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.