• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Insert Google Analytics Code

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Insert Google Analytics Code

This topic is: not resolved

Tagged: Track that Stat

  • This topic has 6 replies, 6 voices, and was last updated 12 years, 10 months ago by patricksears.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • February 8, 2013 at 9:11 pm #19147
    connect
    Participant

    I have read some topics on inserting  Google Analytics code, most of which suggests inserting into the Templates > Genesis > Footer(PHP) - but when I look at this file it says - WARNING: This file is part of the core Genesis framework. DO NOT edit  this file under any circumstances. Please do all modifications in the form of a child theme. 

    I was thinking the code was to be inserted:-

    <?php
    wp_footer(); // we need this for plugins
    do_action( 'genesis_after' );
    ?>

    HERE

    </body>
    </html>

    But now I am not sure if I am looking at the right file - Can someone please advise..!

    February 8, 2013 at 9:17 pm #19148
    Susan
    Moderator

    Per this thread: 

    Rather than making any changes to any functions files, go to Genesis > Theme Settings, scroll to the bottom of the screen, and place the code into the second box from the bottom. It will output the code into the wp_head () section.

    June 10, 2013 at 6:05 am #44989
    works
    Member

    Thank you Susan, your kind instructions helped me too!

    June 17, 2013 at 2:56 pm #46408
    Stefani
    Member

    Hi there!  I'm sure this is a silly question...but by putting the script in that wp_head section, that will track stats on every page of the site, right?

     

    Thank you!

    June 17, 2013 at 3:05 pm #46411
    Bill Murray
    Member

    If you load the script in the head, it will track stats for every page, provided that: a) the visitor has javascript enabled and b) the visitor is on the site long enough for the script to load.

    That (b) is important in that the Google javascript is asynchronous - it won't block loading the page. If your page otherwise is "heavy" and Google's servers are a little slow at that moment, a visitor may leave your site before the tracking script finishes loading, so that visitor won't be tracked.


    Web: https://wpperform.com or Twitter: @wpperform

    We do managed WordPress hosting.

    June 17, 2013 at 7:04 pm #46471
    Stefani
    Member

    Great, thank you!!

    August 9, 2013 at 12:06 pm #55283
    patricksears
    Member

    Hi,

    What about Track that Stat code? I have Google Analytics, but was advised to also add in Track that Stat. It was great at first, but then stopped working, so I was advised to remove the plug-in. This morning, I de-activated the Track that Stat plugin and it really messed up my site. In some browsers, the site would not even open and in others, the formatting was all messed up. My hosting company can't help since it's a plug-in, but said it was some left over code they inserted, probably in the header. Yikes! I have no idea what that code could be or how to get rid of it. Any ideas?

    This was the error message after I de-activated it:

    Parse error: syntax error, unexpected '|' in /home/content/52/8613152/html/wp-content/plugins/widget-logic/widget_logic.php(270) : eval()'d code on line 1

    Parse error: syntax error, unexpected '|' in /home/content/52/8613152/html/wp-content/plugins/widget-logic/widget_logic.php(270) : eval()'d code on line 1

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/52/8613152/html/wp-content/plugins/widget-logic/widget_logic.php(270) : eval()'d code:1) in /home/content/52/8613152/html/wp-includes/pluggable.php on line 875

    Thanks!!

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble