Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1222049
    glynnek
    Participant

    Hi all, I’m struggling to get Google Analytics to work on my site. I’ve searched the forums and read some of the previous questions related to this. I’ve tried using the x-addon of google analytics, Google Analytics Dashboard for WP and finally Google Analytics by MonsterInsights. All of the plugins seem to work as normal but I can’t find any code relating to my GA account in my source code anywhere, and no data is registering on GA. I have cloudflare set up and noticed that on one of the other questions some code has been added to the functions.php I’ve added this code and still can’t seem to get things working. Any ideas? Thanks in advance for any responses.

    My site is http://www.yellowfly.co.uk
    Wordpress v4.6.1.
    X Theme v4.6.2
    Cornerstone v1.3.3

    the code I’ve added to the functions.php file is:

    add_action(‘wp_footer’, ‘exclude_my_ga_code_from_cloudflare’, 9999);
    function exclude_my_ga_code_from_cloudflare() {
    ?>
    <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-85691607-1’, ‘auto’);
    ga(‘send’, ‘pageview’);

    </script>
    <?php
    }

    #1222148
    Thai
    Moderator

    Hi There,

    Can you please purge / clear the CloudFlare cache again?

    If it doesn’t work, would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link login to your site
    – WordPress Admin username / Password

    Don’t forget to select Set as a private reply. This ensures your information is only visible to our staff.

    Thanks.a

    #1222879
    glynnek
    Participant

    Thanks for the reply, I’ve cleared the cache again as requested. I’ve just checked for the tracking code in google analytics and it is showing up as working. When I view the source code for my home page though, I can’t find the tracking code anywhere? I’ll leave it overnight and see if I get any data and I’ll get back to you if I don’t have any luck. Thanks, Glynne

    #1223013
    Jade
    Moderator

    Sure, let us know how it goes.

    #1306832
    LaZK
    Participant

    Hello!

    I am also struggling to get Google Analytics working on my site. I am very new to this.

    I’ve put the code snippet into Addons -> Google Analytics -> Settings -> Analytics Code. And marked ‘head’ in Position.
    When I go to GA report – there are 0s on every part.

    My website is: http://prisluhnem.si/

    Thank you!

    Laura

    #1306844
    Lely
    Moderator

    Hello Laura,

    Thanks for posting in and giving us your site URL.
    When I check your site, the code was added correctly. But then there are 2 tracking codes on your site:

    <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','ga');
    
    ga('create', 'UA-75297221-3', 'auto');
    ga('send', 'pageview');
    
    </script>

    And this:

    <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','ga');
    
      ga('create', 'UA-89512191-1', 'auto');
      ga('send', 'pageview');
    
    </script>

    Please double check which one is supposed to be there.
    You may also check this thread:https://www.en.advertisercommunity.com/t5/Google-Analytics-Reports/Why-is-GA-showing-zero-traffic/td-p/505159#

    Cheers!

    #1306929
    LaZK
    Participant

    Hello Lely,

    thank you for your reply.
    The first code is a remnant of me, trying to navigate all this new info πŸ˜‰ and I’ve put it under child theme editor something.

    I think I’ve cleared the first one. But I don’t know where to check.
    If I understood correctly, it can take up to 48 hours for GA to start showing the traffic?
    (I am not in a hurry for traffic info, just for me to know, that I won’t be checking GA every hour or so πŸ˜‰ ).

    Thank you.

    Laura

    #1306966
    Lely
    Moderator

    Hello Laura,

    Report data shows up in your reports within 24 hours of setting up the tracking code. You may check this link if it shows zero after that:https://support.google.com/analytics/answer/1009683?hl=en

    Hope this helps.

  • <script> jQuery(function($){ $("#no-reply-1222049 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>