Title: Installing google analytics
Last modified: August 20, 2016

---

# Installing google analytics

 *  [samuraicc](https://wordpress.org/support/users/samuraicc/)
 * (@samuraicc)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/installing-google-analytics-5/)
 * How do I install google analytics code?
 * It says I must place it onto everypage I want to be tracked..
 * where do I place it? In my index?
 * samurailabs.cc/MissionControl/

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

1 [2](https://wordpress.org/support/topic/installing-google-analytics-5/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/installing-google-analytics-5/page/2/?output_format=md)

 *  [Krishna](https://wordpress.org/support/users/1nexus/)
 * (@1nexus)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/installing-google-analytics-5/#post-2878195)
 * You need to place the code only once in WP, place it just before the closing 
   </head> tag.
 *  [Erick Hitter](https://wordpress.org/support/users/ethitter/)
 * (@ethitter)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/installing-google-analytics-5/#post-2878210)
 * You’re best off using one of the many available plugins. I’ve had great success
   with [Google Analyticator](http://wordpress.org/extend/plugins/google-analyticator/)
   and [Google Analytics for WordPress](http://wordpress.org/extend/plugins/google-analytics-for-wordpress/),
   but you can find many more here: [http://wordpress.org/extend/plugins/search.php?q=google+analytics](http://wordpress.org/extend/plugins/search.php?q=google+analytics).
 *  Thread Starter [samuraicc](https://wordpress.org/support/users/samuraicc/)
 * (@samuraicc)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/installing-google-analytics-5/#post-2878257)
 * I see all these pages I can edit…
 * witch one of these pages is the one where I should place the code?
 * Footer
    (footer.php) Theme Functions (functions.php) Header (header.php) Image
   Attachment Template (image.php) theme-options.php widgets.php Main Index Template(
   index.php) Page Template (page.php) Search Results (search.php) Search Form (
   searchform.php) Showcase Template Page Template (showcase.php) sidebar-footer.
   php Sidebar Template Page Template (sidebar-page.php) Sidebar (sidebar.php) Single
   Post (single.php) Tag Template (tag.php) Styles Stylesheet (style.css) Visual
   Editor RTL Stylesheet (editor-style-rtl.css) Visual Editor Stylesheet (editor-
   style.css) RTL Stylesheet
 *  [Krishna](https://wordpress.org/support/users/1nexus/)
 * (@1nexus)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/installing-google-analytics-5/#post-2878258)
 * Open the Header (header.php) and place the Google Analytics code just before 
   the closing </head> tag. See guidelines [HERE](http://support.google.com/googleanalytics/bin/answer.py?hl=en&answer=174090).
 * But remember, when you update the theme, the code will be lost and you have to
   place it back again, unless you are using a child theme.
 *  [ManueBresson](https://wordpress.org/support/users/manuebresson/)
 * (@manuebresson)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/installing-google-analytics-5/#post-2878369)
 * Hello,
 * I want to install google analytics code on my blog. I am not a geek. I don’t 
   want to use a plugin as they say it slowers the site so if i prefer to do it 
   myself. where to find the page to insert the code?
    thanks for your help. Emmanuelle
 *  [Krishna](https://wordpress.org/support/users/1nexus/)
 * (@1nexus)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/installing-google-analytics-5/#post-2878370)
 * Please read my post above. It is done without any plugins.
 *  [ManueBresson](https://wordpress.org/support/users/manuebresson/)
 * (@manuebresson)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/installing-google-analytics-5/#post-2878371)
 * Hello Krishna,
 * Before posting my message, I read the thread and opened your link. How can i 
   enter in my source code page to place the code? Once i have placed it, will google
   analytics will track all my entire blog?
    Emmanuelle
 *  [Krishna](https://wordpress.org/support/users/1nexus/)
 * (@1nexus)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/installing-google-analytics-5/#post-2878372)
 * Go to header.php (Dashboard > Editor) and locate </head> and place the Google
   Analytics code just before the closing head tag and save it.
 * > will google analytics will track all my entire blog?
 * Yes.
 * But, you will lose the code when you update the theme next time. You can replace
   it at the same place as soon as you update the theme.
 *  [ManueBresson](https://wordpress.org/support/users/manuebresson/)
 * (@manuebresson)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/installing-google-analytics-5/#post-2878373)
 * hello Krishna,
 * Below, i have posted what is the html before the closing head tag. Do I have 
   to place the code before /* =Header?
 * Thanks
 * Emmanuelle
 * #access a.assistive-text:active,
    #access a.assistive-text:focus { background:#
   eee; border-bottom: 1px solid #ddd; color: #1982d1; clip: auto !important; font-
   size: 12px; position: absolute; text-decoration: underline; top: 0; left: 7.6%;}
 * /* =Header
 *  [bythegram](https://wordpress.org/support/users/bythegram/)
 * (@bythegram)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/installing-google-analytics-5/#post-2878374)
 * As Krishna also mentioned this change will be erased the next time you update
   your theme so you really should consider using a plugin. One of the plugins by
   Erick Hitter at the top of this thread would do the trick and I highly doubt 
   you will notice a speed difference in your site.
 *  [Krishna](https://wordpress.org/support/users/1nexus/)
 * (@1nexus)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/installing-google-analytics-5/#post-2878375)
 * Don’t you find the header.php?
 *  [ManueBresson](https://wordpress.org/support/users/manuebresson/)
 * (@manuebresson)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/installing-google-analytics-5/#post-2878376)
 * Hello,
 * Sorry, i was in the wrong page. I copied pasted below what’s before and after
   the closing head tag and inserted the code. Is it right what I have done?
    Thanks
   in advance. Cheers, Emmanuelle
 *     ```
       * tag of your theme, or you will break many plugins, which
       	 * generally use this hook to add elements to <head> such
       	 * as styles, scripts, and meta tags.
       	 */
       	wp_head();
       ?>
       <script type="text/javascript">
   
         var _gaq = _gaq || [];
         _gaq.push(['_setAccount', 'UA-35437858-1']);
         _gaq.push(['_trackPageview']);
   
         (function() {
           var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
           ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
           var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
         })();
   
       </script>
       </head>
   
       <body <?php body_class(); ?>>
       <div id="page" class="hfeed">
       ```
   
 * _[Moderator Note: Please post code or markup snippets between backticks or use
   the code button. As it stands, your code may now have been permanently damaged/
   corrupted by the forum’s parser.]_
 *  [Krishna](https://wordpress.org/support/users/1nexus/)
 * (@1nexus)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/installing-google-analytics-5/#post-2878377)
 * It looks OK and should work. You can verify at your Analytics account too.
 *  [jhonson](https://wordpress.org/support/users/ravia/)
 * (@ravia)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/installing-google-analytics-5/#post-2878378)
 * after the end of header.php file he can paste the script of any where
 *  [ManueBresson](https://wordpress.org/support/users/manuebresson/)
 * (@manuebresson)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/installing-google-analytics-5/#post-2878379)
 * Thank you all for your help. It works! I don’t know what would I do withouth 
   this forum!
    Cheers, Emmanuelle

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

1 [2](https://wordpress.org/support/topic/installing-google-analytics-5/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/installing-google-analytics-5/page/2/?output_format=md)

The topic ‘Installing google analytics’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 18 replies
 * 8 participants
 * Last reply from: [Vegan Water Kefir](https://wordpress.org/support/users/vegan-water-kefir/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/installing-google-analytics-5/page/2/#post-2878389)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
