Skip to content

Install Google Analytics in WordPress with Google Site Kit

Google Analytics is by far the most popular site-analytics system in the world. This fact has many causes, but one unarguable one is that it helps that Google Analytics is free. With or without that as a cause, it’s common to need to install GA in WordPress. I always use a plugin (though I’m pretty agnostic about which). Here’s why:

  • As a plugin, you can change themes without it affecting your Google Analytics setup. This means that you’ll either not have an accidental gap in your data, and/or you don’t need to install it with each changing theme.
  • I like excluding admins, and other WordPress users, from Analytics. You can write this code yourself relatively easily, but most plugins include this functionality for free, no effort required.
  • If you’re not comfortable editing PHP, HTML, and or JavaScript, adding the code manually is scary. Plugins allow you to skip touching code.

For this video, I chose to use “Site Kit plugin from Google”. Here’s the video on how to set it up:

How to Create a Google Analytics Account/Site

  1. Be logged into your Google account that you want the Google Analytics accounts connected to.
  2. If you’re new to Google Analytics, you’ll be presented with a nice simple “wizard” process when you go to https://analytics.google.com. Walk through that process.
  3. If you don’t see the wizard at that URL, you’ve probably been attached to a GA account before. If that’s you, you’ll go to the gear “Admin” label on the left-hand side of the GA interface. There you’ll want to create a new “Account” by selecting “Create a new account” from the bottom of the dropdown on the left, which is labelled “Account”. That’ll give you the same screen the “wizard” does. (This is the process I go through in the above video).

How to Install Google Analytics in WordPress

  1. Go to “Plugins > Add New” in your WordPress site.
  2. Search for “Site Kit” on that page. (Do note that it is “site kit” and not “sitekit”–the latter search always gives me confusing results.)
  3. Install and activate the “Site Kit by Google” plugin.
  4. Once the plugin is active, you’ll have to set it up. You’ll like see a big banner at the top of the page to guide you through. If not, you can find the setting page under “Site Kit” in the left side menu of your site. Unlike most plugins, Google thinks it’s pretty important, so you’ll find the thing titled “Site Kit” between “Dashboard” and “Posts,” pretty high in the left-side menu.
  5. On that page, click the “Start Setup” button at the top of your page. Then you’ll click “Sign in to Google”…
  6. At this point, you’ll proceed through the pop-up modal dialog for a few more click. By now in your digital life, I’d guess you’ve done things like this before, so I’ll omit the extra details. (If you would have benefited from more detail, please leave a comment.)
  7. Unfortunately the first-pass through Google Site Kit install Search Console tools, not Google Analytics. So you’ll need to do the whole cycle again, clicking on the “Analytics > Connect Service” button. It’s a similar flow to #6. So again I’ll leave you to the legally-required number of clicks.
  8. Once back on the site, you’ll confirm which of your Google Analytics accounts to connect to. After you confirm that, you’re set!

You can verify that installation was successful by loading your site in a “Incognito” or “Private Browsing” window. If you “View Source” on that page, you should be able to find some numbers like “UA-#########-#” which you selected in step 8. Then you’ll start collecting data on what your site visitors are doing on your site. 🙂

Yay! 🎉 You made it to the end of the article!
David Hayes
Share:

0 Comments
Inline Feedbacks
View all comments

Or start the conversation in our Facebook group for WordPress professionals. Find answers, share tips, and get help from other WordPress experts. Join now (it’s free)!