WordPress.org

Ready to get started?Download WordPress

Forums

Google Analytics Problems (2 posts)

  1. pete9071
    Member
    Posted 1 year ago #

    I'm trying to install Google Analytics to my blog. I've tried the plugins, but none of them work, so I've resorted to trying to install it myself and I'm having problems. Anything wrong with this code?

    </div>
    
    </div>
    </div>
    <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/script.js"></script>
    <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-41502146-1', 'footballbettor.co.uk');
      ga('send', 'pageview');
    
    </script>
    </head>

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

    Thanks,
    Pete

  2. essaysnark
    Member
    Posted 1 year ago #

    The code snippet in this post is definitely not correct. There should not be div tags in the head section of a page. I don't personally know about the actual Google Analytics call but it generally looks correct to my nonexpert eyes. However, since you still have the Yoast plugin on your page then that alone could be causing problems if you're trying to hardcode the GA stuff in elsewhere. When you say the SEO plugins aren't working, what do you mean by that? The Yoast plugin is quite good. You might try researching whatever problem you're having on that plugin's support site: http://wordpress.org/support/plugin/wordpress-seo

Topic Closed

This topic has been closed to new replies.

About this Topic