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

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)!

0
Would love your thoughts, please comment.x

Most Searched Articles

Best JavaScript Libraries and Frameworks: Try These 14 in 2024

In this post, we look at the best JavaScript libraries and frameworks to try out this year. Why? Well, with JavaScript being available in every web browser, this makes it the most accessible programming language of ...

20 Best Free WordPress Themes for 2024 (Responsive, Mobile-Ready, Beautiful)

If you're looking for only the best free WordPress themes in the market for this year, then you're in the right place. We have more than enough such themes for you right ...

12 Best WordPress Hosting Providers of 2024 Compared and Tested

Looking for the best WordPress hosting that you can actually afford? We did the testing for you. Here are 10+ best hosts on the market ...

Handpicked Articles

How to Make a WordPress Website: Ultimate Guide for All Users – Beginners, Intermediate, Advanced

Many people wonder how to make a WordPress website. They’ve heard about WordPress, its incredible popularity, excellent features and designs, and now they want to join the pack and build a WordPress website of their own. So, where does one get ...

How to Start an Ecommerce Business: Ultimate Guide for 2024

Is this going to be the year you learn how to start an eCommerce business from scratch? You’re certainly in the right place! This guide will give you a roadmap to getting from 0 to a fully functional eCommerce business. ...