- This topic has 19 replies, 4 voices, and was last updated 2 years ago by
David.
-
AuthorPosts
-
January 2, 2019 at 5:53 am #770996
Monica
I am trying to find documentation to walk me through the steps on how to add the Google Analytics tracking code to my Generate Press theme. Thanks
GeneratePress 2.2.1GP Premium 1.7.7January 2, 2019 at 6:25 am #771014Marcus
Download plugin “header and footer” and then add the code in header ๐
January 2, 2019 at 6:44 am #771033Monica
Thanks Marcus. I was reading there was something inside GeneratePress where I can add it? Hooks? elements? Was looking for steps for it.
January 2, 2019 at 6:53 am #771152Patrick
Hi Monica, I used a GP hook to add my tracking code (actually Google Tag Manager). You can generate the tracking code, then use the “head” and “body” hooks to insert the JS.
January 2, 2019 at 7:38 am #771191Monica
Thanks Patrick. Do you know if there is documentation or steps on how to add it?
January 2, 2019 at 8:03 am #771208Tom
Lead DeveloperLead DeveloperYou can add it using the Hook Element: https://docs.generatepress.com/article/hooks-element-overview/
Add your tracking code, then choose the
wp_head
hook and set your Display Rules ๐Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJanuary 2, 2019 at 11:13 am #771386Patrick
Monica, as far as generating the GA code itself, here’s some documentation. Google Tag Manager is a little more involved: You have to install the GTM container in the header/body, then create a tag that tracks all pageviews using your GA code. However, if you plan on adding more than one tag (like the Facebook pixel, or some sort of event tracking), GTM is probably worth it.
January 5, 2020 at 11:09 pm #1123190Robi
Hello Tom. I used a hook to paste the code and followed all the instructions mentioned. But it did not work. But the problem was fixed when I used the header and footer plugin. But I would still want to achieve the same using hook inside GP. Any way to do so? Is there anything I did wrong? But I believe I did exactly what was mentioned on that instructional video – hooks-element-overview.Does it take time to reflect the changes using hook?
January 6, 2020 at 2:33 am #1123300David
StaffCustomer SupportHi there,
never had any issues with using the GP Hook Element for adding Google Analytics.
1. Appearance > Elements > New > Hook.
2. Add your GA Script or the first GTM Script.
3. Selectwp_head
hook from the list
4. Set Display Rules for Entire site.For GTM only – the second code is added like so:
1. Create another new Hook.
2. Add the scond GTM Script.
3. Selectwp_body_open
hook from the list
4. Set Display Rules for Entire site.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/May 8, 2020 at 12:21 pm #1275828Ish Kumar
Hi David,
I have added same code as mentioned by you to add Google Analytics, but still can’t see the results in analytics page. How much time we should wait?
May 8, 2020 at 4:08 pm #1276039Tom
Lead DeveloperLead DeveloperShouldn’t take long. Maybe something like this will help: http://www.gachecker.com/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMay 21, 2020 at 7:48 pm #1296121nutt
Just about what I am looking for
June 1, 2020 at 2:30 am #1309527Quentin
Hi,
I did it exactly the way David mentioned above. Added the tracking code and after a few minutes google analytics showed activity in the stats. But when I am using GA Checker I just see ticks at “global site tags” on all tested URL’s but the other 3 options next to it are red crossed.
Is it ok or do I have to do anything else?
Thank you very much
June 1, 2020 at 4:46 am #1309666David
StaffCustomer SupportHi there,
if you have only added the GTM tags then that is correct.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/June 24, 2020 at 7:32 am #1340179Elmehdi
I’ve gone to my google analytics>admin>tracking code>and copy pasted the gtag in there into the hook element as suggested. However, the only results I get is who entered my site and from where. Any engaging happen like clicking links it doesn’t show up at all…can you help me?
-
AuthorPosts
- You must be logged in to reply to this topic.