Community Forums › Forums › Archived Forums › General Discussion › Insert Google Analytics Code
Tagged: Track that Stat
- This topic has 6 replies, 6 voices, and was last updated 10 years, 8 months ago by patricksears.
-
AuthorPosts
-
February 8, 2013 at 9:11 pm #19147connectParticipant
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 #19148SusanModeratorRather 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 #44989worksMemberThank you Susan, your kind instructions helped me too!
June 17, 2013 at 2:56 pm #46408StefaniMemberHi 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 #46411Bill MurrayMemberIf 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 #46471StefaniMemberGreat, thank you!!
August 9, 2013 at 12:06 pm #55283patricksearsMemberHi,
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!!
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.