admin管理员组文章数量:1296320
I know how to create child theme for wordpress theme but having problem in installing Google Tag Manager into the child theme. Normally there are two files in the child theme directory (one is stylesheet css and another one is function.php) however, Google suggests to put the identification code into the header.php file, so in this case is there any way to put the identification code of Google Tag manager into the child theme.
I know how to create child theme for wordpress theme but having problem in installing Google Tag Manager into the child theme. Normally there are two files in the child theme directory (one is stylesheet css and another one is function.php) however, Google suggests to put the identification code into the header.php file, so in this case is there any way to put the identification code of Google Tag manager into the child theme.
Share Improve this question asked Apr 9, 2021 at 13:06 Rabbi HussainRabbi Hussain 12 Answers
Reset to default 1You have a couple of options -
Install a plugin that adds GTM for you. This makes it very easy, but it does add another plugin to the site. Site Kit supposedly slows down a site more than you would expect.
Make a copy of header.php and put it in your child theme folder. Now you can make edits to this file without the edits being overwritten when the parent theme is updated. That's how the child theme works. Anything you want to edit gets copied into the child theme. By default you only get the stylesheet and functions.php, but you can put any theme file into the child theme for editing.
You can install a plugin for adding the tag. Google's official Site Kit or WP Global Site Tag by Digital Apps could help.
本文标签: Is there any way to put the Google Tag manager Identification code into the child theme
版权声明:本文标题:Is there any way to put the Google Tag manager Identification code into the child theme? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741624672a2389014.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论