Connect Google Analytics to WordPress in four steps
Google Analytics tracks who visits your WordPress site, what pages they look at, and how long they stay. To start collecting this data, you need a Google Analytics account, a tracking code, and a way to place that code on every page of your site. The fastest method is using a plugin — a small piece of software that does the work for you without touching any code.
You do not need to be technical. The process takes about 15 minutes and involves signing into Google, creating a property for your site, and installing one free plugin on WordPress.
Key Takeaways
- You need a Google account to create a Google Analytics property, which is where your site's visitor data will be stored.
- The easiest way to connect WordPress to Google Analytics is using the MonsterInsights plugin, which handles the tracking code automatically.
- After you install the plugin and connect it to your Google Analytics account, data starts collecting within a few hours.
- Google Analytics shows you how many people visited, which pages they viewed, how long they stayed, and where they came from.
Create a Google Analytics account and property
Start by going to google.com/analytics and signing in with your Google account. If you do not have a Google account, create one first — it takes two minutes and you only need an email address.
Once you are signed in, click the blue "Start measuring" button. Google will ask you to name your account (use your business name or site name), then create a property. A property is where Google stores data about one specific website. Name it after your WordPress site.
On the next screen, enter your website URL (the full address, like yoursite.com) and select your industry category and time zone. Click "Create" at the bottom. Google will then show you a Measurement ID — a code that starts with "G-" followed by numbers and letters. Copy this ID and keep it somewhere you can find it in the next five minutes. You will paste it into WordPress.
Install and set up MonsterInsights
MonsterInsights is the most popular plugin for connecting WordPress to Google Analytics. It is free for the basic version and handles all the technical work. Go to your WordPress dashboard, click "Plugins" on the left side, then click "Add New."
In the search box at the top right, type MonsterInsights. The first result will be "MonsterInsights – Google Analytics Dashboard for WordPress." Click "Install Now," then click "set up" once the installation finishes.
After set up, a new menu item called "Insights" will appear on the left side of your WordPress dashboard. Click it to open the plugin.
Connect your Google Analytics account to WordPress
Inside MonsterInsights, click the blue "Connect Google Analytics Account" button. A window will pop up asking you to sign in to Google. Use the same Google account where you created your Analytics property.
Google will ask for permission to let MonsterInsights access your Analytics data. Click "Allow." You will then see a list of your Google Analytics properties. Find the one you just created (it will have your site name) and click it to select it.
MonsterInsights will confirm the connection and show you a green checkmark. Your WordPress site is now sending visitor data to Google Analytics. You do not need to do anything else — the plugin handles the tracking code automatically.
Check that data is flowing correctly
Data collection starts within a few hours, but it can take up to 24 hours for Google Analytics to show your first visitors. To check if the connection is working, go back to your Google Analytics account at google.com/analytics, click on your property, and look at the "Realtime" report on the left side.
The Realtime report shows people visiting your site right now. Open your WordPress site in a new browser tab and visit a few pages. Within a few seconds, you should see yourself appear in the Realtime report. If you see your visits counted, the connection is working.
If you do not see any activity after 24 hours, go back to MonsterInsights in WordPress and check that the green checkmark still shows. If the connection has dropped, click "Reconnect" and sign in to Google again.
Understand what Google Analytics shows you
Once data starts flowing, Google Analytics displays several key numbers. Users is the number of people who visited your site. Sessions is the number of visits — one person might visit twice and count as two sessions. Pageviews is how many pages were viewed in total.
The "Acquisition" report shows where your visitors came from: search engines, social media, direct links, or other websites. The "Behavior" report shows which pages people viewed most and how long they stayed on each one. The "Audience" report shows basic information about your visitors, like what country they are in and what device they used.
You can view all of this inside WordPress using MonsterInsights, or log into Google Analytics directly for more detailed reports. Most people check the data once a week to see which content is getting attention.
Troubleshoot common connection problems
If MonsterInsights shows a red X instead of a green checkmark, the connection has broken. This usually happens if you changed your Google password or revoked the plugin's permission. Click "Reconnect" in MonsterInsights and sign in to Google again.
If you see data in Google Analytics but not in MonsterInsights, the connection is working — MonsterInsights just needs a few hours to sync the data. Refresh the page after a few hours and the numbers should appear.
If you see no data anywhere after 24 hours, check that you selected the correct property when connecting. Go to MonsterInsights, click "Reconnect," and make sure you choose the property that matches your site URL. If you accidentally created a property for the wrong site, you can delete it in Google Analytics and create a new one.
Frequently Asked Questions
Do I need to pay for Google Analytics?
No. Google Analytics is free for most websites. You only pay if your site gets more than 10 million hits per month, which is extremely rare for small and medium-sized sites. MonsterInsights also has a free version that works for basic tracking.
Will adding Google Analytics slow down my WordPress site?
No. Google Analytics uses a small tracking code that loads in the background and does not affect your site's speed. MonsterInsights is also lightweight and will not cause noticeable slowdown.
Can I see how many people visit each page?
Yes. In Google Analytics, go to "Behavior" and then "Site Content" to see a list of every page on your site with the number of visitors to each one. This shows you which content is popular and which pages need attention.
What if I already have Google Analytics set up a different way?
If you manually added a Google Analytics tracking code to your WordPress theme, you should remove it before installing MonsterInsights. Having two tracking codes will count visitors twice. Remove the old code from your theme's header file, then install MonsterInsights.
How long does it take to see visitor data?
The connection is when ready, but Google Analytics takes a few hours to process and display data. Check back after four to six hours to see your first visitor numbers. Real-time data appears within seconds, but historical reports take longer to populate.