Archived topic
Add Google Analytics tracking code to head of each page or just the front page
3 replies · Started by Sid on May 10, 2021
Hi team
How do i go about adding my Google Analytics tracking code to head of each page or just the front page.
Im new to all this so need help. Read some answers about hooks etc but im lost..
Is there a quick way i can do this similar to adding how I add custom CSS to theme in the designated area.
Hope all this makes sense.
Thanks
Hi there,
A hook element is what you need:
https://docs.generatepress.com/article/hooks-element-overview/
Simply select wp_head under hook name and display to entire sites should work.
As for adding CSS, take a look at this:
https://docs.generatepress.com/article/adding-css/
Hey Leo
Thats a great answer and thank you for the link to the video. Even an amature like myseld understood hook elements.
I'll give this a try and any issues give you a shout.
Thanks and keep up the good work with this amazing template :)
Thank you for the kind words!