How to Add Google Analytics to Your WordPress Website

Google Analytics

With so many companies running WordPress, I thought we’d take a moment to show you how to add the Google Analytics tracking code to your WordPress website.

During recent web design projects for Sage and Microsoft partners, I’ve noticed a few websites that are missing Google Analytics tracking code because:

1. It was never installed in the first place. Or ..

2. It was installed on the old website but was never migrated to the new WordPress site.  Or ..

3. It was installed at one time but didn’t get transferred over when you changed your WordPress theme recently.

Whatever the reason, Google Analytics provides insight into how much traffic you generate, where that traffic is coming from, how long visitors stay, and so many other important metrics that help you determine what’s working, what’s not, and how to make your Inbound Marketing effort more effective.

Note: New Universal Analytics

Even if you already have Google Analytics running on your website, you might want to consider updating the tracking code to the new Upgraded Universal Analytics. It’s a new innovation in the way that data is collect in Google Analytics which ultimately provides you with even more reports and deeper insight to make informed marketing decisions.

Upgrading to the New Universal Analytics is the same process as described below.

So here we go!

It’s Go Time: Adding Google Analytics Code to WordPress

Here are step-by-step instructions for adding the code to your WordPress website:

1. Login to Google Analytics at www.google.com/analytics

2. Click the Admin menu at the top

Google Analytics Admin Menu

3. Select the appropriate “Account” and “Property” (website) from the drop down menus

Note: you might only have one to choose from which makes it easy. Some of us have multiple accounts/clients/websites in the dropdown options so choose the right one!

4. In the “Property” column (in the middle), click “Tracking Info

5. Under “Tracking Info” click on “Tracking Code” that appears in the dropdown menu

Google Analytics Tracking Code

6. On the next screen in the dialogue box under “This is Your Tracking Code”, highlight and copy everything in the box from the opening <script> bracket to the closing </script> bracket.

Google Analytics Tracking Code

Now Over to Your WordPress Website

Once you have the Google Analytics tracking code/script copied, it’s time to head over to your WordPress website. In most cases, you’ll need Administrator access to perform these steps.

1. Login to WordPress

2. Navigate to your “Theme Settings” or “Theme Options.”

Different theme providers use different terminology. But essentially you’re looking for field that allows you to paste the Google Analytics code in the site-wide header.  Some theme providers will even label the field with a description like “This is where you’d paste your Google Analytics Code.” That makes it easy.

Note: For users of the Genesis WordPress Framework (like us!), go to:

Genesis > Theme Settings > Header and Footer Scripts (field)

Genesis theme settings

Add Analytics Code to Header

3. Click “Save Settings” and you’re done!

Alternative Option: Use a Plugin

If you find this approach (above) too technical or difficult to do, you can always install a Google Analytics plugin for WordPress which creates a nice user-friendly interface and makes it easy just add your Google Analytics account number (no scripts or headers to worry about).

The only drawback is that you now have one more plugin to manage, update, and potentially conflict with your theme or other plugins that are installed which can create real problems.  The fewer plugins you use, the less potential for headaches.

Video: Add Google Analytics in Less Than 60 Seconds

Are you more of a visual learner? Then here’s a video that shows the process of adding Google Analytics to WordPress in less than 60 seconds!

Got Questions?

Leave us a comment below.

Leave a Reply

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