Archived topic
Google Analytics tracking code
10 replies · Started by Anonymous on September 19, 2014
Hi, I want to use Google Analytics with my GeneratePress site. Where is the best place for me to put the Google Analytics tracking code? As a header or footer element somewhere? Should I edit a file directly?
Hi there,
If you have our GP Hooks addon, you can place it in the wp_footer area.
If not - you can use a plugin: https://wordpress.org/plugins/google-analytics-for-wordpress/
Let me know if you have any questions :)
Perfect, thanks!
You're welcome!
Tom,
For the Google Analytics tracking code, it is not better to put it in the before_Header area of the GP Hooks addon.
I think I read it is better to put it just right after the body tag.
Oups. Just read to put it before the </head> tag.
Ah, they do actually suggest you put it before the </head> tag.
I'm not sure how much it matters, but if that's the case, the code can go in the wp_head area of the Hooks.
Hello
Regarding that topic, once I pasted the GA code, should I also click the PHP box?
Thanks
Laia
Only if you've added PHP in there.
If it's just the GA code, then checking the PHP box isn't necessary :)
I bought premium but I don't find where I get the GP Hooks addon option?
Answered here:
https://generatepress.com/forums/topic/gp-hooks/#post-839287