How-to add Google Analytics tracking code to wordpress

You may add the Google Analytics tracking code to you site either manually or with a plugin. There are many plugins that can help you do this, but I have selected a very simple one, that get the job done simple and sweet.

Adding Google Analytics manually

  1. Login wordpress admin panel
  2. Goto Appearance > Editor (theme editor)
  3. Select the footer.php or index.php
  4. Find the </body> html tag
  5. Copy and page the Google Analytics code before the </body> tag.
  6. Don’t forget to click Update File to save changes.

The only problem with the manual installation is that if you swap wordpress themes you will loose your  Google Analytics tracking. That is why it is better to handle the Google Analytics tracking code within a plugin. The selected plugin is a simple plugin with no-mumbo-jumbo.

Adding Google Analytics with the Header-Footer plugin

  1. Download and install the Header-Footer plugin
  2. Goto Settings > Header-Footer
  3. Cut and paste the google tracking code in the bottom footer textbox.
  4. Enjoy.

If you are looking for a more advanced feature packed plugin that can also handle the above and more, you might want to try HeadSpace2.

Please note that this tip requires wordpress installed on your webhost.

No TweetBacks yet. (Be the first to Tweet this post)
Tweet This Tweet This Post!


3 Responses to “How-to add Google Analytics tracking code to wordpress”

  1. I don’t like using plugin for google analytics because it make my site slower


  2. Thank you very much. Info was helpful. GA code works now,
    All the best
    CD


  3. I changed http://www.webtechglobal.co.uk theme about 3 times and used a plugin to deal with analytic code but I’m on my final theme because I’m happy with it so it is coded into the header.php for good reason.

    Where possible get the analytics code in the head of your header.php file and avoid having another plugin in the list for the blog to load, the files using storage space, more files to backup and you’ll be minus an sql query. The header in a Wordpress theme already does a lot of work which is not required if your sticking to the same theme forever. Actually with some php removed from the header your blog will run much faster, it is a service WebTechGlobal offers with money back if you don’t notice speed increase.

    My point is plugins add to your blogs work load but are still the right option when you can see the code option having to be done too many times over the course of you perfecting your blog.

    Ryan


Post a Comment


Aweber
AnHosting
Free wordpress blog installation service
Dreamhost


  • Links

Custom Content