Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    That code is part of Google Analytics.

    How have you added GA to your site? Have you added it manually or via a plugin?

    Looking at the source code I can see…

    <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','//www.google-analytics.com/analytics.js','ga');
    
      ga('create', 'UA-52773093-1', 'auto');
      ga('send', 'pageview');
    
    </script>
      ga('send', 'pageview');

    It’s that final line that needs removing as it’s redundant, appearing after the </script>.

    David.

    Hi arch2309,

    The code is of Google Analytics. It seems that you have not added the Google Analytics script properly.

    The script in the header is as follows:


    <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','//www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-52773093-1', 'auto');
    ga('send', 'pageview');

    </script>
    ga('send', 'pageview');

    Delete the last line so it would become


    <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','//www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-52773093-1', 'auto');
    ga('send', 'pageview');

    </script>

    This should solve your problem.

    The important thing here is that code below the </script> line.

    David.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘I see this code’ is closed to new replies.