Home → Blogging →

How to Add Google Analytics to WordPress [4 Easiest Ways]

Written by, Dimitar F

Updated April, 17, 2022

Every online business needs to track its website performance to ensure it gets noticed, increases its search engine visibility, and brings in more conversion. To do all that, you need to learn how to add Google Analytics to WordPress. 

It may seem quite technical, but with this tool, you can easily measure and boost the performance of your website.  We’ll guide you through the process, so you can track essential metrics, even if you’re not a tech Whiz. Here’s what we’ll cover:

Now let’s dig deeper to learn how you can use Analytics to boost your site performance and ensure search engine optimization. We’ll explore the whole process with WordPress since it’s the most popular website builder for non-coders. It’s easy and functional, just like Google Analytics.

If you have a reliable web hosting service provider and a website, all you have to do is install Google Analytics on your site to start tracking performance. Your web hosting provider will ensure that your site is up and running round the clock. But what do you need Analytics for?

Why You Need to Add Your Website to Google Analytics

Did you know that:

  • Google Analytics powers approximately 28,832,505 sites online.
  • It’s the most popular visitor count tracking usage distribution technology in the US, with an 87% share, followed by 51.La with 8% of the market share.

Before you install Google Analytics on the WordPress website, you should understand why you need it. In short, it’s more than a web analytic tool. And it can help you spear through the competition and rank high in the SERPs (search engine page results). Plus, Google Analytics provides free tools to analyze crucial data that helps in various ways.

Check Business Performance

You have access to everything needed to check the performance of your site content, products, and marketing campaigns. When you’re aware of the results, you can strategize and change your SEO and digital marketing tactics accordingly.

Better Understand Your Audience

Once you add Google Analytics to the WordPress site, you can receive in-depth data that will help you understand your customers. Here’s how:

View Website Visits

The website visits show how many people come to your page daily, weekly, and monthly. These analytics help you keep up with the rise and falls so that you can ensure your site grows in popularity.

View Visitor Demographics

Analytics displays the location of your website visitors. Also, you can learn about their age, language, gender, and the devices they use to access your page. All this will help fine-tune your marketing message and convert the visitors into customers.

Find Out Traffic Sources

Uncovering your most profitable traffic sources is the ultimate lead generation for your business. Whether it’s email, social media, or SEO, you’ll want to know where to focus your efforts. And that’s another reason why setting up Google Analytics on WordPress is essential for your success.

Check the Bounce Rate

No site owner wants a high bounce rate. That shows that you’re generating leads, but they’re not converting. If that’s an issue, know that user experience is crucial for your success. You can’t overlook the importance of UX. Poor user experience and high bounce rate might occur for many reasons, including:

  • Targeting the wrong people
  • Not engaging content
  • Unoptimized website 

You can use Google Analytics to assess your site’s bounce rate quickly. Based on that, you can improve your content strategy, carry out A/B testing to see what works and what doesn’t or tweak the website layout to ensure a better conversion rate.

Other important metrics that you can gauge from Analytics include:

  • Sessions
  • Average session duration
  • New session percentage
  • Pageviews
  • Goal completions

Now that you know the benefits of this tool and why you need it, let’s sign you up and see how to add Google Analytics to WordPress.

Step-By-Step Guide to Help Users Sign Up With Google Analytics

Here is a quick guide to help you sign up and start receiving full reports on your website performance:

Step 1: Sign Up With Your Gmail Account 

Analytics is a free tool, so anyone can sign up. All you have to do is visit the Google Analytics website and log in with your Gmail account.

Then, you’ll be prompted to provide an account name and some details.

Step 2: Choose the Service

Here, you need to pick where you’ll use the Google Analytics scripts — on your website, application, or both. Make sure to choose “web” for your site. Then, you’ll have to enter all the website details like its name, URL, time zone, and country.

Step 3: Accept Terms and Conditions

It’s good to read them carefully, so you understand what you’re getting into. But we doubt you’ll listen to this recommendation. When you’re ready, click on the “I agree” button. 

Step 4: Get a Tracking Code

Now, it’s time to receive your Google Analytics tracking code. Copy the code as you’ll have to use it later in your WordPress website to connect your Analytics.

How to Add Google Analytics Code to WordPress

You can choose to do that in different ways. We’ll explain the easiest options, so read through them and pick the one that sounds suitable for you.

MonsterInsights Plugin

It’s one of the more common plugins you can use to set up Google Analytics as it’s the easiest. Beginners prefer this option as the plugin has a free version. Keep in mind that if you don’t upgrade to premium, you’ll miss out on some fantastic features like:

  • Ecommerce tracking
  • Ads tracking
  • Author tracking

You can consider the paid version when your business scales. In any case, here’s how to add Google Analytics to WordPress with the plugin:

  1. First, create a MonsterInsights account on the website and download the plugin.zip file.
  2. Next, go to your WordPress website dashboard.
  3. In the plugins section, click “Add New” and choose the “Upload Plugin” button.
  4. Select the file button to upload the zip file from the second step. When you do that, you’ll see the installed plugin on your WordPress website. Next, you’ll use the plugin to add Google Analytics code to WordPress.
  5. Click the “Activate” button for the plugin to get it started. That will open the setup wizard where you’ll have to do the following:

Choose your website category.

Use the license key for connecting the plugin to your website.

Connect your Google account with the MonsterInsights account. Select the same one you used for Google Analytics.

Finally, allow MonsterInsights to connect with Google Analytics. That will finalize the authentication. You’ll receive some default recommendations for events tracking, enhanced link attribution, download tracking, and Monster Insight reports. Choose whatever you need and save. 

Thanks to this plugin, you can view your Google Analytics data directly in the WordPress dashboard. 

Headers and Footers Plug-in

  • To add the website to Google Analytics with this method, simply copy the tracking code you received for Google Analytics. Then, install and activate the Headers and Footers plugin by following the steps for the MonsterInsights plugin.
  • On the plugin settings page, copy the tracking code into the tab “Scripts in headers.” Click to save your changes. That’s all you have to do so Google Analytics can function on your website. But it won’t perform advanced tracking configurations.
A woman is writing and working on a tablet

How to Add Google Analytics to WordPress Without a Plugin

If you’re familiar with coding and have some technical expertise, you’ll be better off going with this method. The drawback is that Google Analytics may disappear if you update the WordPress theme.

You simply have to copy and paste the tracking code into the header.php file and save your changes. Alternatively, you can add the code via the functions file. That will add it automatically to all of your website pages.

Google Tag Manager

The tag management system lets you update tags fast and code snippets to your site for marketing optimization and traffic analysis. Sites make use of Google Tag Manager to incorporate Google Analytics scripts for various purposes.

Simply download and activate the Tag Manager plugin to your site. First, you’ll need to make a Google Tag Manager account and create your container. Copy the container ID and paste it on the WordPress ID in the Plugin settings page. Any tag you set up in Google Tag Manager, such as Google Analytics, will begin to work.

Use Google Analytics to Your Business Advantage

After setting up Google Analytics on WordPress, you can use the data to improve your business. Pay attention to the following data on the dashboard:

  • Users
  • Session Duration
  • Sessions
  • Bounce Rate
  • Active Users
  • Acquisition Sources

That will give you a quick snapshot of your website performance. But you can adjust the dashboard overview to show the metrics that you’re targeting.

How Long Does It Take for Google Analytics to Start Tracking?

The data won’t appear right away. So, if you see Google Analytics not showing data, know that it takes 24–48 hours to show web traffic and collect data.

But to ensure that Google Analytics is set up correctly, check the real-time reports. If you installed the MonsterInsights plugin, go to the dashboard and click “Insights and Reports.” Then, go to the real-time tab. If you can spot active users on the website, Google Analytics is working, and the data will be available soon.


With billions of websites crawling the internet, it’s not easy to get noticed. But tools like Google Analytics can truly help business owners to manage, monitor, and optimize their websites. The data can help you identify loopholes and redefine marketing strategies and SEO tactics to boost your online performance and improve your conversion rate.

So, now you know how to add Google Analytics to WordPress and get started. Analyze your website for success. Good Luck!