Archived topic
Analytics script
5 replies · Started by Álvaro on December 4, 2019
Hello dear Generate Press team.
When we update your theme or plugin, Google analytics script is deleted... I think you can improve this.
Thanks
Hi there,
How did you add the code?
Let me know :)
Hello leo, I add it at header.php in Editor theme.. Here in other web with your theme-plugin: http://alvaropicho.com/wp-admin/theme-editor.php?file=header.php&theme=generatepress
Do you recommend me other way?
Hi there,
you should never edit the Theme files as they will always be overwritten when the theme is updated.
Instead use a Hook Element:
https://docs.generatepress.com/article/hooks-element-overview/
You will add your code to its content, select the WP_Head hook and set the Display Rules to Entire Site.
Perfect, I done!
thank you David and Leo
Glad we could be of help