- This topic has 9 replies, 3 voices, and was last updated 1 year, 6 months ago by
Leo.
-
AuthorPosts
-
December 21, 2020 at 9:38 am #1589669
Nicola
Hello π
I have installed GP Premium and the child theme: to install Google Tag Manager I will have to insert the tag in the header file, but it is absent in the child theme.
To create it, can I copy and paste the header file from the parent theme or do I need to make some other changes?
Thank you for your help in this matter! π
December 21, 2020 at 5:30 pm #1589992Leo
StaffCustomer SupportHi there,
You don’t actually need a child theme to install GOogle Tag Manager.
Simply create a hook element using
wp_head
hook should do:
https://docs.generatepress.com/article/hooks-element-overview/
https://docs.generatepress.com/article/wp-head/Let me know if this helps π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 22, 2020 at 8:07 am #1590867Nicola
Hi π
Thank you for your reply, I also found the guide that explains it π I have installed the child theme only to install Google Tag Manager so is it necessary that I leave the child theme activated or can I use the parent theme?
Thank you π
December 22, 2020 at 8:21 am #1590879David
StaffCustomer SupportHi there,
if you have added the GTM to your Child Theme then you must keep it enabled.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 22, 2020 at 9:17 am #1590951Nicola
Hi,
Thank you very much π If I install the GTM in the parent theme, and I don’t need any other changes, is it useful that I continue to use the child theme or can I disable it?
I’m sorry for the questions and thanks for your help π
December 22, 2020 at 10:40 am #1591034David
StaffCustomer SupportYou should never edit the parent theme files.
If you want to add it without a child theme then following this article:https://docs.generatepress.com/article/implement-google-tag-manager/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 22, 2020 at 11:08 am #1591067Nicola
Ok, I have the last question: I previously added the GTM tag following that guide but with the child theme active. Following that guide, does the theme have to be parent or child?
Thank you for your help and I’m sorry because I’m not expert π
December 22, 2020 at 12:46 pm #1591182David
StaffCustomer SupportIf you used the Function method ie. this:
https://docs.generatepress.com/article/implement-google-tag-manager/#using-functions
Then those files are added to your Child Theme. And Yes you must keep the Child Theme Active.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 22, 2020 at 2:17 pm #1591248Nicola
Thank you π And if I use the hook method do I have to keep the child theme active or is it not necessary? I installed the child theme only to add the GTM tag, in case that I don’t need the child theme to use the hook method and I don’t have to make other changes, would it be necessary to keep the child theme active?
Thank you! π
December 22, 2020 at 2:32 pm #1591268Leo
StaffCustomer SupportAnd if I use the hook method do I have to keep the child theme active or is it not necessary?
No – you don’t need a child theme in this case π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.