When You Should (and Shouldn’t) Use a WordPress Plugin

Last week, we discussed how WordPress plugins are one of WordPress’ greatest strengths … and how they can also be one of its greatest weaknesses.

The key to effective use of plugins is to deploy them only from properly vetted sources, and only when necessary.

Plugins should solve a specific problem or provide an essential function. They should not indulge our vanity or our desire for a “shiny new object”.

In this post, let’s get specific and discuss a decision-making framework for a specific type of plugin that can be applied across many different plugins.

We’ll focus on a type of plugin that we see often, and whether it’s needed or not — plugins for Google Analytics.

Do You Need a Plugin to Run Google Analytics?

Before you ask yourself what plugin you should use to install and manage Google Analytics code on your website, ask yourself this more important question first:

Because if you do not need a plugin for Analytics, why install one?

Obviously, if you wanted to get literal, no one truly needs a Google Analytics plugin. Without much effort, you can copy the Analytics code and paste it into either your header.php or footer.php file (or just drop it into a simple box, if you use the Genesis Framework) so that it gets called on every page.

However, installing Google Analytics code in this way presents the following potential issues:

  • If you’re not comfortable editing PHP, you could screw up your header or footer file and not know how to fix it.
  • If you ever change to a new theme, you have to remember to re-install the code on the new theme. (Note: I’ve done this before and forgotten; the missed traffic information is unrecoverable.)
  • If you want to track custom variables or include other settings different than the standard, you have to know how to alter the actual Analytics code you are given. For greenhorns, this can be tricky.

If you think any of these bullet points could possibly be an issue for you in the future, then a Google Analytics plugin is worth considering. There’s a need there, and you would be solving for a specific issue or issues.

But Wait — Do You Really Need a Plugin?

Now that you know you need assistance installing your Analytics code, there is actually one more question to ask before you head over to the WordPress plugin repository:

Does your theme have a built-in option to take care of Analytics code installation for you?

Many people do not realize that their theme — especially if it’s a premium framework like Genesis — usually has a place in the settings where you can install header and footer scripts.

If this option is available, simply copy the Analytics code into the section for header scripts.

This method eliminates one potential problem from above (you don’t have to touch the PHP code) and partially eliminates another: so long as you only change child themes, but not theme frameworks, the Analytics code will always be installed properly. If you do decide to switch theme frameworks, however, make sure you remember to re-install your Analytics code.

But what about those folks who need to customize their Analytics code, to track pageviews by author?

I run Midwest Sports Fans on the Genesis Framework, so I could use the settings area to copy the script and be safe even if I change child themes; but would a plugin be better so I can easily customize the code options?

Yes, yes it would.

And once you get to this point, it’s all about choosing the right plugin.

Which Google Analytics Plugin Should I Use?

Google Analytics is a popular traffic program, so it should surprise no one that there is a plethora of plugins available for it. I have tried out a number of them over the years, but I always ended up coming back to one in particular:

Google Analytics for WordPress by Joost de Valk.

There are a number of reasons why I like this plugin and recommend it to anyone who needs one for Google Analytics. Here are the top five:

  1. Joost is among the most trusted plugin developers in the WordPress community.
  2. The plugin allows for one-click enabling of custom variable tracking such as Author Name, Single Category, Tags, and others.
  3. The newest version uses asynchronous tracking, which increases accuracy and load time.
  4. The plugin is integrated with the Google Analytics API, so it could not be easier to set up new sites.
  5. There is ecommerce tracking available for those would need it.

I have never had one negative issue with this plugin, and I use it on almost every site I run.

We’ll never recommend a plugin to you that we don’t trust.

The Big Picture

As we conclude this post, not only do you have an A+ recommendation for a Google Analytics plugin, but you should also understand the thought process to engage in any time you are contemplating using a plugin.

Ask these questions first:

  • Is the issue I’m trying to solve or the functionality I’m trying to provide necessary?
  • Do I need plugin-type help to find a solution?
  • Does my theme have a built-in way to provide it?

If the first two answers are “Yes” and the final answer is “No” then you should grab a plugin.

Then do your homework, pick the best one, and confidently take the next step towards intelligently deploying WordPress plugins that work.


  1. In fact, I didn’t install Google Analytics for my blog, that’s why I didn’t need this WP plugins, thanks for your post, I think I also need to remove some other plugins that I don’t need any more.

  2. I use quite 6-7 plugins but i’m worried they’re slowing my site down. I do need them though. great post.

  3. Plug-In overdose. I’ve been there…it’s gotten so bad that I had to deactivate a bunch of them and start from scratch. Less is More. Especially with plug-ins. Stick to the basics and you’ll get much better results. True Story!

  4. Really nice article.
    I use as little plugins as i can.
    However 5-10 are required.
    My choice for ga is the same than yours.
    Thank you

  5. A timely post Jerod. Thanks.

    I paid the price of overdosing on plugins over the weekend. Google Analytics among them, even thought my web developer had perviously added the code. The load time on my site had slowed dramatically and I had to purge a number of the unnecessary plugins to speed it back up.

  6. We use a core set of plugins for most word press installs we do that we feel don’t slow a site down but I would love to see any recommendations you had for quantitatively analyzing your site speed and identifying specific plugins or combinations of plugins that are slowing things down.
    Most of the plugins we are using for our current site help the user experience or site layout such as the addition of meta content, better lead gen forms, columns or breadcrumbs.
    I don’t know your policies for posting links and this might seem ironic, but I did find a free plugin that helps audit your plugin usage and identify problem areas. Here is the link

    Hope that helps!

    Herb Jones
    Online Potential inc

  7. A theme should not have built in support for something like Google Analytics to begin with, actually. If it does, then the theme has too many options, frankly. Something such as Google Analytics is definitely plugin-territory. Why? Because Google Analytics has zero to do with the theme.

    The theme should be focused on one specific goal: Displaying your content in the way you want it displayed. Google Analytics isn’t part of “displaying your content”, now is it? That is about tracking your visitors, and that is outside the scope of a theme. Therefore, yes, it is absolutely plugin territory, and you absolutely should be using a plugin to do it. If the code to do it is in the theme, then you should disable that code, and use a plugin instead.

    Why use a plugin instead of the theme support? Because when you change the theme, the plugin will continue to work. Anything that you want to happen on your site regardless of which theme you’re using should be in a plugin.

    Note to theme authors: if you have this sort of thing in your themes, then you are doing-it-wrong.

    • Jerod Morris :

      Otto, thanks for the visit and comment. You bring some good points, some of which I addressed, and some of which go into my own thinking using a Google Analytics plugin on MSF, for example, even though the Genesis framework provides an easy place to paste the code. Personally I use the plugin because of the advanced options I need selected, but you are right that it also mitigates the risk of losing visitor tracking should you switch themes and forget to bring the plugin over.

      Specific to Analytics, I think the argument FOR a plugin is much stronger than with other plugins. I also believe, and our philosophy is, that trimming any excess plugins is a good thing. We are obviously strong advocates of StudioPress and Genesis, so I really would not fear keeping my plugin code tied to the theme, because I don’t ever plan on leaving. But that’s a matter of personal preference, with your way probably being “safer” for most.

      I think the overall point is that while plugins are good, and can provide excellent add-on functionality for WordPress, relying on them to do every non-core action that you need is a recipe for disaster. Approaching it from a minimalist mindset and then finding specific, defensible reasons to use plugins – as you have in your comment – should be the thought process.

  8. I wish I could highlight Otto’s comment, but I can’t, so here’s a link instead, just in case you missed it up there.

  9. This is a good thought process to go through before installing any plugin. Personally, I use the Thesis framework and there are many tutorials that show you how to add a lot of functionality without having to use certain plugins. If you’re familiar with PHP…that’s usually no problem. But for those just getting started, getting a plugin is the easiest thing.

    • Jerod Morris :

      Great point Freddy. The more that you can do without plugins, the better. But for beginners, so long as they are discerning and vet the plugins, they can add a lot of value.

Leave a Reply