Archived topic
How to Add Google Analytics Code to Generate Press
19 replies · Started by Monica on January 2, 2019
Hi there,
i replied to your topic here:
https://generatepress.com/forums/topic/how-to-insert-google-analytics/#post-1340353
I propose at the very minimum make an effort to let people add Analytics in a normal way as is done with 99% of premium WP themes. Laypeople don't exactly know what "hooks" are.
Hi there,
if anyone has difficulty understanding hooks then this article and Toms great video really does explain how to do this.
https://docs.generatepress.com/article/hooks-element-overview/
There are significant advantages of using hooks over having a dedicated field for just Analytics. We have to consider 'what ifs' - such as what if Google changes the way you add their codes in the future? It would be awful to have redundant code for a dedicated area in the Theme if that ever happened.
I am facing problem with these!
can you please provide step by step guide?
I have checked this whole thread and still not able to install google analytics!
This article provides all the steps required from adding Google Tag Manager:
https://docs.generatepress.com/article/implement-google-tag-manager/
If your only using Google Analytics then google only provides you with a single script - in that case you only apply the steps require for the 'first block' of code.