Site logo

Archived topic

Adding Google Analytics to GeneratePress

7 replies · Started by Nate on October 4, 2018

Viewing posts 1–8 of 8

Hi, I am trying to add Google Analytics to GeneratePress and I am not sure I did it correctly.

Do I just need to select Add Element => Hooks => Select WP_Head Hook and paste the tracking code above while also selecting all pages in the location?

Anything else I need to do?

Hi there,

Thats the correct hook. For the display rule choose Entire Site if you want everywhere covered.
The second script they provide which needs to be added after the opening body tag, you can do the same but use the before_header hook

Thanks David. Not sure I understand the second script. When I go to GA the only thing I see is the full script for: Global Site Tag (gtag.js)

Is there another hook to setup somewhere and if so where would I get that info from Google Analytics?

Sorry my bad - if its just GA then one script. If using Google Tag Manager its two.

Gotcha, I honestly did not even know about Google Tag Manager. It looks like it would be helpful though for tracking. Do you guys have a support article or tutorial on installing it on the site?

GTM is really handy for managing your tags from the google console, instead of adding or changing codes in the site. There are lots of guides online about setting it up. Include "the right way" in your search, its easy to do but just as easy to get wrong.

For GP its just a case of hooking in the two scripts as mentioned above.

Gotcha, thanks David

You're welcome

This archived topic is closed to new replies.