Title: Inserting Google tag manager
Last modified: September 11, 2018

---

# Inserting Google tag manager

 *  [nichere](https://wordpress.org/support/users/nichere/)
 * (@nichere)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/inserting-google-tag-manager/)
 * i am using the child theme OceanWP. How do i install the google tag manager into
   my header and body? I only have style.css and functions.php in my editor. Thanks

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/inserting-google-tag-manager/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/inserting-google-tag-manager/page/2/?output_format=md)

 *  [Amit Singh](https://wordpress.org/support/users/apprimit/)
 * (@apprimit)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/inserting-google-tag-manager/#post-10676777)
 * Hello, use Insert Header and Footer plugin.
 *  Thread Starter [nichere](https://wordpress.org/support/users/nichere/)
 * (@nichere)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/inserting-google-tag-manager/#post-10677102)
 * thanks and for the body ?
 *  Thread Starter [nichere](https://wordpress.org/support/users/nichere/)
 * (@nichere)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/inserting-google-tag-manager/#post-10677135)
 * or how can i get it inside the editor ?
 *  [Amit Singh](https://wordpress.org/support/users/apprimit/)
 * (@apprimit)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/inserting-google-tag-manager/#post-10677175)
 * You need to only place code in the Head section of your site for Google Tag Manager.
 * If you also want to add code in the body section. Go to editor > and select header.
   php file. Add your code here within the body.
 *  Thread Starter [nichere](https://wordpress.org/support/users/nichere/)
 * (@nichere)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/inserting-google-tag-manager/#post-10677280)
 * ok Thanks Amit
 *  Thread Starter [nichere](https://wordpress.org/support/users/nichere/)
 * (@nichere)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/inserting-google-tag-manager/#post-10677291)
 * I dont have header.php in the editor i only have finctions.php ( i added the 
   script there and it gave me an error. it doesnt make sense that i would add a
   script for the body but enter it into the header.php ?
 *  [Amit Singh](https://wordpress.org/support/users/apprimit/)
 * (@apprimit)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/inserting-google-tag-manager/#post-10677301)
 * Hello,
 * Please read the guide here – [Google tag manager](https://www.wpbeginner.com/beginners-guide/how-to-install-and-setup-google-tag-manager-in-wordpress/)
 *  [Amit Singh](https://wordpress.org/support/users/apprimit/)
 * (@apprimit)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/inserting-google-tag-manager/#post-10677307)
 * If you will open header.php file then you will find body tag in it.
 * You need to copy header.php file in your child theme to make any change.
 *  Thread Starter [nichere](https://wordpress.org/support/users/nichere/)
 * (@nichere)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/inserting-google-tag-manager/#post-10677338)
 * I dont have a header.php as mentioned in my opening question. I have added that
   plug in header and footer. But i need to add the script to the body.
 * How about this then….how can i add a header.php to the editor ?
 *  [Amit Singh](https://wordpress.org/support/users/apprimit/)
 * (@apprimit)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/inserting-google-tag-manager/#post-10677397)
 * You can add your code in the body section by the following method.
 * 1) Header.php file located in the OceanWP parent theme. Copy this file and paste
   it in your child theme.
    Now go to editor and add code after the body tag.
 * 2) go to appearance > widget > sidebar widget.
    Add your code in this sidebar
   widget using custom HTML widget.
 *  Thread Starter [nichere](https://wordpress.org/support/users/nichere/)
 * (@nichere)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/inserting-google-tag-manager/#post-10677399)
 * now trying via cpanel
 *  Thread Starter [nichere](https://wordpress.org/support/users/nichere/)
 * (@nichere)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/inserting-google-tag-manager/#post-10677405)
 * I am using the child version. This is why it doesnt enable access to the header.
   php
 * do i need to modify in the Oceanwp theme or the child theme ?
 *  [Amit Singh](https://wordpress.org/support/users/apprimit/)
 * (@apprimit)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/inserting-google-tag-manager/#post-10677413)
 * Please follow the above mentioned steps.
 *  Thread Starter [nichere](https://wordpress.org/support/users/nichere/)
 * (@nichere)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/inserting-google-tag-manager/#post-10677426)
 * ok,,,do i paste the header.php into the functions.php of the child theme ?
 *  [Amit Singh](https://wordpress.org/support/users/apprimit/)
 * (@apprimit)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/inserting-google-tag-manager/#post-10677443)
 * No, just copy the header.php file and paste it into your child theme folder along
   with the function.php file.
 * Now use an editor to open it and add your code.

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/inserting-google-tag-manager/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/inserting-google-tag-manager/page/2/?output_format=md)

The topic ‘Inserting Google tag manager’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/oceanwp/4.1.6/screenshot.png)
 * OceanWP
 * [Support Threads](https://wordpress.org/support/theme/oceanwp/)
 * [Active Topics](https://wordpress.org/support/theme/oceanwp/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/oceanwp/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/oceanwp/reviews/)

 * 21 replies
 * 2 participants
 * Last reply from: [nichere](https://wordpress.org/support/users/nichere/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/inserting-google-tag-manager/page/2/#post-10677748)
 * Status: not resolved