Understanding how visitors interact with your website is crucial to its growth and success. Google Analytics is a powerful tool that helps you track and analyze user behavior, traffic sources, and much more. Whether you’re running a blog or an e-commerce store, installing Google Analytics on your WordPress website is wise. It is also a smart decision if you have a business site. It can greatly benefit your website. This guide will walk you through the process step by step.
Table of Contents
🛠️ Step-by-Step Guide to Install Google Analytics on WordPress
Step 1: Create a Google Analytics Account
- Go to Google Analytics.
- Sign in with your Google account.
- Click Start measuring.
- Set up your account name and choose the relevant data-sharing settings.
- Click Next, then set up a property:
- Add your website name (Ex, howtokh.com).
- Select your reporting time zone and currency.
- Click Next and answer the business information questions.
- Click Create and accept the terms. Follow with the below screenshot => Get started today


Enter your account name

Select box and click Next

Enter your website account name again

Text box and click on Create

Then accept the Google Agreement

Step 2: Set Up a Data Stream
- Choose Web as the platform.
- Enter your website URL and give it a stream name.
- Click Create Stream.
- You will now see your Measurement ID (looks like:
G-XXXXXXXXXX
).

Enter your website URL and give it a stream name.

Step 3: Install Google Analytics on WordPress
You can install Google Analytics using either a plugin (easiest method) or by manually inserting the tracking code.
🔌 Option A: Using a Plugin (Recommended)
Most popular plugins:
- MonsterInsights
- Site Kit by Google
- GA Google Analytics
We’ll use Site Kit by Google here.

Steps:
- Log in to your WordPress Admin Dashboard.
- Go to Plugins > Add New.
- Search for Site Kit by Google.
- Click Install Now, then Activate.
- Click Start Setup.
- Sign in with your Google account and connect Google Analytics.
- Follow the on-screen prompts to grant permissions and verify ownership.
- Once setup is complete, your site will be connected to Google Analytics.

After clicking on Go to Dashboard => click on Get your client ID to get ID directly and fast

Click on Get Credentials

Enter the project name and => Next

After clicking on NEXT, you will get the Client ID, copy it and paste it into the Client ID box

When you paste the Client ID into the box, already => click on Complete Set up

It will show the message successfully as below and back to google and click on DONE


📝 Option B: Manually Add the Tracking Code
- Go to your Google Analytics dashboard.
- Copy the Global Site Tag (gtag.js) code from the Web Stream Details.
- In WordPress, go to:
- Appearance > Theme File Editor (or use a child theme to avoid overwrites).
- Open the
header.php
file.
- Paste the code right before the closing
</head>
tag. - Click Update File.
✅ Step 4: Confirm Tracking is Working
- Return to your Google Analytics dashboard.
- Go to Reports > Realtime.
- Open your website in another tab and see if your activity shows up.
Installing Google Analytics on your WordPress site is an essential step toward understanding your audience and making informed decisions. You can choose a plugin. Alternatively, you can add the code manually. The insights you’ll gain will help you grow your site more effectively. Don’t forget to check your analytics regularly to see what’s working—and what’s not! Anyway, maybe you want to know how to install Google Tag Manager also. Learn more with us.
Discover more from How To Kh
Subscribe to get the latest posts sent to your email.