Title: Google analytics
Last modified: August 22, 2016

---

# Google analytics

 *  Resolved [applebaker](https://wordpress.org/support/users/applebaker/)
 * (@applebaker)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/google-analytics-115/)
 * Where do I place google analytic codes? On google it says to place it straight
   after <body> tag on the template. When I did that i get strings of php error 
   above my header on my webpage.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [jaska120](https://wordpress.org/support/users/jaska120/)
 * (@jaska120)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/google-analytics-115/#post-5507617)
 * You should place it inside header so that means right BEFORE closing </head> 
   tag in header.php
 * Jaska
 *  [CrouchingBruin](https://wordpress.org/support/users/crouchingbruin/)
 * (@crouchingbruin)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/google-analytics-115/#post-5507621)
 * Just make sure you are not editing the theme’s header.php file directly. Otherwise,
   you will lose your changes when the theme gets updated. You should either create
   a [child theme](http://codex.wordpress.org/Child_Themes) and work off a copy 
   of header.php, or use a plugin that will insert anything you want into the <head
   > section. I personally prefer using a plugin, so that if the header.php is one
   of the files that gets upgraded in the next version of the theme, I’ll be able
   to use the upgraded features of the file. I like the [Header and Footer](http://wordpress.org/plugins/header-footer/)
   plugin for adding scripts like Google Analytics.
 *  [socalrescue](https://wordpress.org/support/users/socalrescue/)
 * (@socalrescue)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/google-analytics-115/#post-5507645)
 * [http://www.wpbeginner.com/beginners-guide/how-to-install-google-analytics-in-wordpress/](http://www.wpbeginner.com/beginners-guide/how-to-install-google-analytics-in-wordpress/)
 *  [Weblizar – WordPress Themes & Plugin](https://wordpress.org/support/users/weblizar/)
 * (@weblizar)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/google-analytics-115/#post-5507710)
 * [@apple](https://wordpress.org/support/users/apple/).baker: Either make a child-
   theme before editing the theme, You can put the script in _header.php_ or in 
   the _footer.php_ or Use Plugin.
 * Thanks

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Google analytics’ is closed to new replies.

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

 * 4 replies
 * 5 participants
 * Last reply from: [Weblizar – WordPress Themes & Plugin](https://wordpress.org/support/users/weblizar/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/google-analytics-115/#post-5507710)
 * Status: resolved