Support » Fixing WordPress » Google Analytics Problems

  • 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?

    <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/script.js"></script>
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      ga('create', 'UA-41502146-1', '');
      ga('send', 'pageview');

    [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.]


Viewing 1 replies (of 1 total)
  • 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:

Viewing 1 replies (of 1 total)
  • The topic ‘Google Analytics Problems’ is closed to new replies.