MENU

Comments (0) World WIde Web

How To Install Google Analytics On A WordPress Blog Without Using A Plugin

Igoogle analyticsf you’ve been blogging for longer than a few months, you’ve probably heard of the ever so popular site analytics program, Google Analytics. It allows blog owners to do such things as:

  • Discover how your site visitors found your blog
  • View how many visitors your blog receives each day
  • View areas on your blog where people have clicked
  • . . . and a ton more.

If you blog, it’s inevitable that you are going to try Google Analytics at some point. It really is a great analytics program; however, I must admit that it can seem quite complex at times and if you’re new to the program and you might feel a bit intimidated. In the near future I’ll try to post some examples on how to use the program.

When it comes to plugging Google Analytics into your blog, you have a couple of options available to you.

  1. Download and use a plugin . . . or
  2. Copy and paste code into your blog’s footer file

Why I don’t like plugins

Simply put, plugins slow down the load time of your website and also pose security risks which could leave your blog open to intruders. Even if the plugin is secure today, it might not be when a newer version of WordPress is released or if the plugin author abandons the program and stops issuing updates.

In my opinion, the best way (and just as easy) to install this is to simply copy and paste Google’s supplied code into your theme’s footer file. That’s it, no plugin, done and move on.

Step 1: Sign up for a new Google Analytics account.

analytics sign up

Step 2: Copy the JavaScript code.

During the sign up process you’ll be asked things like your name, email address, etc. At some point, you’ll come to a page that looks like the image seen below. You will will need to copy this code and paste it into your blog.

analytics code

As a side note, even if you used a plugin to install Google Analytics, you would still need to copy and paste this code at some point; so plugins don’t necessarily make things any easier.

Step 3: Pasting the code into your footer.php file

At this point, log into your WordPress blog and navigate to your theme’s editor by going to Dashboard -> Appearance –> Editor.

theme editor

Then on the right you should see a list of your theme’s files. Click on the Footer.php file.

footer

Paste the code you copied from Google Analytics just above the ending </body> tag.

paste code

Click Update File

update

And that’s it. No plugins and no worries about updates.

To view your site’s statistics now, log into your Google Analytics account and view your stats. It may take a day or so to start receiving your traffic stats, so if you don’t see it right away, just be patient.

Source: Website Security

 

Leave a Reply

Your email address will not be published. Required fields are marked *