- This topic has 19 replies, 4 voices, and was last updated 3 years, 3 months ago by David.
-
AuthorPosts
-
January 2, 2019 at 5:53 am #770996Monica
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
January 2, 2019 at 6:25 am #771014MarcusDownload plugin “header and footer” and then add the code in header ๐
January 2, 2019 at 6:44 am #771033MonicaThanks 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 #771152PatrickHi 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 #771191MonicaThanks Patrick. Do you know if there is documentation or steps on how to add it?
January 2, 2019 at 8:03 am #771208TomLead 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 ๐January 2, 2019 at 11:13 am #771386PatrickMonica, 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 #1123190RobiHello 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 #1123300DavidStaffCustomer 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.May 8, 2020 at 12:21 pm #1275828Ish KumarHi 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 #1276039TomLead DeveloperLead DeveloperShouldn’t take long. Maybe something like this will help: http://www.gachecker.com/
May 21, 2020 at 7:48 pm #1296121nuttJust about what I am looking for
June 1, 2020 at 2:30 am #1309527QuentinHi,
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 #1309666DavidStaffCustomer SupportHi there,
if you have only added the GTM tags then that is correct.
June 24, 2020 at 7:32 am #1340179ElmehdiI’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.