Title: Where to embed Google Analytics code?
Last modified: August 19, 2016

---

# Where to embed Google Analytics code?

 *  [Kalamazoo](https://wordpress.org/support/users/kalamazoo/)
 * (@kalamazoo)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/where-to-embed-google-analytics-code/)
 * I’ve read that it should be embeded at the footer.php at the current template
   just before </head>. It is ok if you have generic template like TwentyTen but
   if you install a new one template, the footer.php in most cases is encoded and
   it does not show the </body> any more.
    Is there an an alternative place where
   you can embed the GA code?
 * Below, I copied the entire footer.php just to show you an axample:
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_

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

 *  [Rafael Sirotheau](https://wordpress.org/support/users/rsirotheau/)
 * (@rsirotheau)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/where-to-embed-google-analytics-code/#post-2041670)
 * > I’ve read that it should be embeded at the footer.php at the current template
   > just before </head>
 * How can the `</head>` be at `footer.php` ? I think you’ve mistaken `footer.php`
   and `header.php` or `</head>` and `</body>`…
 * I’ll wait for your pastebin code so I may help…
 *  [up2early](https://wordpress.org/support/users/up2early/)
 * (@up2early)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/where-to-embed-google-analytics-code/#post-2041695)
 * I use the Google Analytics plugin to handle this. It places the code in the header
   by default and also allows you to place it manually. It is available [here](http://yoast.com/wordpress/google-analytics/)
 * Good luck!
 *  Thread Starter [Kalamazoo](https://wordpress.org/support/users/kalamazoo/)
 * (@kalamazoo)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/where-to-embed-google-analytics-code/#post-2041736)
 * Sorry for a little mistake, I meant </body> and not </head>

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

The topic ‘Where to embed Google Analytics code?’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [Kalamazoo](https://wordpress.org/support/users/kalamazoo/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/where-to-embed-google-analytics-code/#post-2041736)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
