ThemeShaper Forums » Thematic

[closed]

Add the New Google Analytics

(6 posts)
  • Started 8 years ago by drw158
  • Latest reply from neonbible
  • This topic is not resolved
  1. Hello, I would like to put Google Analytics into Thematic. I do not use the child theme. Analytics now puts the code in the head tag right before the </head> tag (not in the footer). You might want to check it out. Also, I don't know hardly any php. Also, will this allow me to put the code onto every page?

    Thanks

    Posted 8 years ago #
  2. you should be using a child theme anyway. even if it is only a basic one that only imports all its style from thematic. in your child's functions.php file try:

    function google_analytics() { ?>
    
    <?php }
    add_action('wp_head','google_analytics',99);

    with a high priority it should be the last thing added just before the </head> tag

    Posted 8 years ago #
  3. Devadaru
    Member

    Or, you can use a Google Analytics plugin to do it for you. (Though on this forum, populated by programmers, this solution may not receive high marks...)
    D

    Posted 8 years ago #
  4. I think the new script and placement is to affect asynchronous loading/tracking.

    Give this a try: http://wordpress.org/extend/plugins/google-analytics-for-wordpress/

    I'm pretty sure Yoast covers all the bases with that one.

    Posted 8 years ago #
  5. i dont think anybody here will shoot down a plugin solution just b/c it is a "plugin". there is no stigma attached. hell i get pumped any time i realize that something i want to do is already accomplished by a plugin. saves a hell of lot of time if i don't have to reinvent the wheel. to echo Gene, the yoast analytics plugin is pretty complete!

    Posted 8 years ago #
  6. neonbible
    Member

    Well I'm going for helga's solution because I can no longer add more plugins to my site. Looks like the host has a php memory limit of 8MB!!

    Posted 8 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.