How to Add Google Analytics to WordPress (Step-by-Step Guide)

How to Add Google Analytics to Your WordPress Site

Running a WordPress website without Google Analytics is like driving blindfolded. I learned this the hard way when I launched my first WordPress site and spent months creating content with no idea which posts actually resonated with my audience or where my traffic was coming from.

After managing dozens of WordPress sites over the past decade, I can tell you that properly setting up Google Analytics is one of the most crucial steps you’ll take for your website’s success. The data you’ll collect will transform how you make decisions about your content, marketing, and business strategy.

Setting up Google Analytics on WordPress used to require diving into code files and risking breaking your site. But I’ve discovered a much easier approach that takes just minutes and requires zero coding skills.

In this guide, I’ll walk you through exactly how I add Google Analytics to WordPress using ExactMetrics, the method I’ve used successfully on hundreds of client sites.

ExactMetrics is the best WordPress Analytics plugin. Get it for free!

 

Why Should You Use Google Analytics?

Google Analytics is an essential tool for tracking and understanding your website visitors. Developed by Google, this free platform offers comprehensive insights into user behavior, helping you optimize your site to grow your business or brand.

Key Benefits of Using Google Analytics:

Visitor Tracking:

  • Geographical Data: Discover where your visitors are coming from.
  • Page Tracking: Identify which pages your visitors land on.
  • Page Views: See the total number of views for each page.

Traffic Source Analysis:

  • Understand how visitors find your website through different channels like search engines, social media, email, and referrals from other sites.

Device and Browser Insights:

  • Learn which browsers and devices (desktop, mobile, tablet) your audience uses to access your site.

Engagement Metrics:

  • Monitor how long visitors stay on your site and how they interact with your content.

Advanced Tracking Features:

Custom Metrics:

  • Beyond basic tracking, Google Analytics allows you to measure additional interactions by setting up key events or conversions, such as form submissions or specific button clicks.

eCommerce Tracking:

  • For online stores, Google Analytics can track product views, total sales, abandoned carts, and more, providing valuable insights to boost sales and improve user experience.

Campaign Tracking:

  • Track the effectiveness of your marketing campaigns to see which strategies drive the most traffic and conversions.

Form Submission and Author Tracking:

  • Monitor form submissions and track content performance by individual authors to understand what content resonates most with your audience.

Keyword Tracking:

  • Identifying which search terms bring visitors to your site helps you optimize your content for better search engine performance.

While Google Analytics offers extensive tracking capabilities, setting up advanced features and interpreting the data can be complex. This guide will walk you through the process, making it easier to leverage these powerful insights for your WordPress site.

But before we get started, let’s take a look at what you’ll need:

What You’ll Need Before Starting

Before we dive into the setup process, make sure you have these essentials ready:

Google Account Access

You’ll need a Google account to create your Google Analytics property. If you already use Gmail, Google Drive, or any other Google service, you’re all set.

WordPress Admin Access

Make sure you have administrator-level access to your WordPress site. You’ll need to install a plugin and adjust settings.

ExactMetrics Plugin

ExactMetrics Google Analytics Plugin

I recommend using ExactMetrics for connecting Google Analytics to WordPress. After testing multiple analytics plugins over the years, ExactMetrics consistently delivers the most reliable setup process and comprehensive reporting features.

Here’s why I choose ExactMetrics for every WordPress Analytics installation:

  • One-click setup with zero coding required
  • Advanced tracking features built in (eCommerce, forms, file downloads)
  • WordPress dashboard reports, so you don’t need to log into Google Analytics separately
  • GDPR compliance features for international visitors
  • Professional support when you need help

Pro Tip: While you can manually add Google Analytics tracking code to WordPress, I strongly advise against this approach. Manual installation increases the risk of breaking your site and requires you to re-add the code every time you update your theme.

How to Add Google Analytics to WordPress

Now that you understand why Google Analytics is essential for your website, let’s look at how you can add it to your WordPress site.

In the following steps, I’ll guide you through setting it up using ExactMetrics, making the process simple and straightforward even for beginners:

Step 1: Download ExactMetrics

ExactMetrics Google Analytics Plugin

ExactMetrics is the best premium WordPress analytics plugin. With ExactMetrics, there’s a whole list of things you can set up and monitor in Google Analytics and your WordPress dashboard without touching a line of code.

You get advanced tracking right out of the box with an extremely user-friendly interface and Google Analytics reports right inside your WordPress dashboard.

Here are some of ExactMetrics’ most popular features:

To start, head to the Pricing page and choose the level that’s right for your site and your goals.

Then, to install the plugin, go to the ExactMetrics website and log in to your account. Once logged in, go to the Downloads tab from your account area.

download-exact-metrics-account

Now click on Download ExactMetrics and download the ZIP file of the plugin.

exactmetrics-downloads-page

Step 2: Create a Google Analytics Account

The first step is to create a Google account if you don’t already have one. To start, go to the Google Analytics website and press Sign in to Analytics or the Start for free button.

Google-Analytics-Sign-Up-Screen

Enter your existing Google email address or phone number to log in. Or, you can click on Create account to create a new account.

create-an-account-for-ga

Once you’re logged in to your Google account, the next step is to sign up for Google Analytics. Click Start measuring to get started.

Google Analytics Welcome Page

Now, enter an Account name for your Google Analytics account. Make sure you’ve checked all the options listed under Account Data Sharing Settings. Then scroll down and click Next.

Create an account google analytics GA4

Next, you’ll enter a name for your Property. Most people choose the name of their business or website. Choose your time zone and currency, then click Next.

google analytics create a property GA4

The third step in creating a Google Analytics account is to provide some business information. Choose your category and business size. Click Next.

google analytics setup business details GA4

 

Lastly, you’ll choose your business objectives. In order to get all of the Google Analytics reports populated in your account, I recommend choosing Get baseline reports.

Google analytics business objectives GA4

Once you’ve selected, click Create.

That’s it! Your Google Analytics account is now up and running. Next, I’ll show you how to add Google Analytics to your WordPress website.

Step 3: Install ExactMetrics on Your Website

Head to the WordPress site where you want to install ExactMetrics and log in.

login-to-wordpress

Then, navigate to Plugins and click Add New. At the top, you’ll see an option to Upload Plugin. Click on it to install ExactMetrics on your website.

upload-a-plugin

Next, click Choose File and go to the folder where you downloaded the ZIP file of ExactMetrics in Step 1. Then, select the ZIP file and click Install Now to upload the plugin.

install-plugin-zip-file

After the plugin finishes installing, click Activate Plugin to set up ExactMetrics.

activate-plugin-exactmetrics

Step 4: Open the Setup Wizard

Now that ExactMetrics is successfully installed on your website, you can connect it to your Google Analytics account.

ExactMetrics offers a simple setup wizard that takes you through each step and makes sure your Google Analytics is correctly set up on your site.

To start, click Launch Setup Wizard.

ExactMetrics Setup Wizard - Add Google Analytics to WordPress

First, you’ll have to select a website type. You can choose from 3 options that best describe your site: Business Website, Publisher (Blog), or eCommerce. Based on your choice, the wizard will offer additional settings for tracking your site’s performance.

Once you’ve selected an option, click Save and Continue.

select-a-site-category

The wizard will now prompt you to enter your license key. You can find it in your email purchase receipt or inside your account area on the ExactMetrics website. Once you’ve entered it, click the Connect ExactMetrics button:

ExactMetrics license key and GA connection

Step 5: Connect Google Analytics

Next, the setup wizard will ask you to connect your Google account. Select the account that contains your Google Analytics profile.

sign-in-with-google

After selecting your Google account, you’ll need to give ExactMetrics permission. It’s important to allow all the permissions, or the plugin will not function properly.

Make sure all the options are selected, and then click Allow.

accounts-google-signin-oauth-consent-summary

Now, you’ll have to select a profile to finish connecting your Google Analytics. If you have multiple websites connected to your Google Analytics account, make sure to select the right website property for tracking.

Complete GA4 connection in ExactMetrics

Once you’ve selected the correct profile, you can click on Complete Connection.

ExactMetrics will then offer some recommended settings based on the website type you selected earlier.

For instance, it will enable Events Tracking and Enhanced Link Attribution by default. By default, the plugin will also track common file type downloads.

complete-the-setup-wizard

If you scroll down, you’ll see more settings. These include Affiliate link tracking, which already has two paths set, but you can add more to affiliate links to track in WordPress.

You can also select the user roles that can view ExactMetrics reports in WordPress.

Once you’re satisfied with the settings, click Save and continue.

In the next step, ExactMetrics will recommend tracking features, addons, and helpful plugins. Choose the ones you want for your site and click Continue.

EM Onboarding Tracking Options

In the final step in the setup wizard, click Finish Setup & Exit Wizard.

That’s it! You’ve successfully connected Google Analytics to your WordPress website.

Do remember that it could take up to 24 hours for the plugin to gather the data and show you reports in your WordPress dashboard.

Step 6: Adjust Google Analytics Settings

Turn off Enhanced Measurement

ExactMetrics automatically creates your data stream in Google Analytics, but if you have already created your own, you’ll need to turn off Enhanced Measurement. In your Analytics account, go to Admin » Data Streams and click on your data stream.

GA4 data streams

Then, click to toggle off Enhanced measurement.

turn off enhanced measurement GA4

After you click the switch, a popup will ask if you want to turn it off. Click Turn off.

turn off enhanced measurement popup

ExactMetrics adds lots of custom, enhanced tracking, and leaving this setting turned on in Google Analytics can actually give you skewed, incorrect data. So, make sure this setting is turned off!

Change Data Retention

Google Analytics will set your event data retention to 2 months by default. If you want to use your data in custom reports beyond 2 months, which most people do, you need to change this.

Go to Admin » Data Settings » Data Retention:

GA4 data retention

Use the dropdown menu to change the setting to 14 months and press the Save button.

That’s it! You’ve successfully configured and added Google Analytics to WordPress!

Step 7: View Your Google Analytics Reports

Now that you’ve completed the setup process for adding Google Analytics, you’ll be able to start viewing your site’s reports in WordPress (after a few hours – up to 24).

Just head to your WordPress dashboard and click on ExactMetrics » Reports (You can also view a quick summary in ExactMetrics’ dashboard widget).

ExactMetrics Overview Report Engagement Analytics

You can use the tabs at the top to view all the other reports available. Check out: How to Find Your Google Analytics Reports in ExactMetrics for more information about your new Google Analytics reports inside ExactMetrics.

How to add Google Analytics to WordPress FAQs:

How to Add Google Analytics to WordPress

Step 1: Download the ExactMetrics Plugin.
Step 2: Create a Google Analytics Account.
Step 3: Install ExactMetrics on Your Website.
Step 4: Open the Setup Wizard.
Step 5: Connect Google Analytics.
Step 6: Adjust Google Analytics Settings.
Step 7: View Your Google Analytics Reports.

What is the best Google Analytics WordPress plugin?

ExactMetrics is the best Google Analytics plugin for WordPress. It simplifies the setup process, requiring no coding skills, and integrates seamlessly with your WordPress dashboard. ExactMetrics offers an intuitive interface and detailed reports, making it easy to use and understand your website’s analytics.

Can I add Google Analytics to WordPress for free?

Yes, you can add Google Analytics to WordPress for free. Simply install the free version of ExactMetrics by searching for “ExactMetrics” in your WordPress dashboard under Plugins » Add New.

How do you add Google Analytics to WordPress without a plugin?

To add Google Analytics to your WordPress site without a plugin, insert the Google Analytics tracking code into your site’s header file. Place the code just before the closing </head> tag. Alternatively, you can use Google Tag Manager, but it has a steep learning curve and may not be suitable for beginners.

I hope you liked our article on how to add Google Analytics to your WordPress site. If this guide was useful, then you might also want to read our article on How to Track Google Analytics Keywords (Step-by-Step).

Don’t forget to follow us on X and Facebook to learn about the latest guides on Google Analytics and WordPress.

FAQs

How long does it take for Google Analytics data to appear in WordPress?

Google Analytics typically takes 24-48 hours to start displaying data after setup. However, real-time reports should show immediate activity once the tracking code is properly installed.

Can I add Google Analytics to WordPress without a plugin?

Yes, you can manually add the Google Analytics tracking code to your WordPress theme files. However, I strongly recommend using a plugin like ExactMetrics because manual installation requires coding knowledge, and the tracking code gets removed every time you update your theme.

Do I need both Google Analytics and ExactMetrics?

ExactMetrics is a WordPress plugin that connects your site to Google Analytics – you need both. Google Analytics collects and stores your data, while ExactMetrics makes it easy to set up tracking and view reports directly in your WordPress dashboard.

Is Google Analytics free for WordPress websites?

Yes, Google Analytics is completely free to use. ExactMetrics offers both free and premium versions – the free version provides basic analytics setup, while premium versions include advanced features like eCommerce tracking and form analytics.

What’s the difference between Google Analytics and WordPress stats?

WordPress.com includes basic built-in stats, but self-hosted WordPress sites don’t have analytics by default. Google Analytics provides much more detailed insights, including traffic sources, user behavior, conversions, and demographic data that basic WordPress stats don’t offer.

Can I track multiple WordPress sites with one Google Analytics account?

Yes, you can create separate properties within one Google Analytics account for multiple websites. Each WordPress site needs its own property and tracking code, but you can manage them all from a single Google Analytics account.

How useful was this post?

Click on the stars to rate

Average rating 0.0/5

Want to Try ExactMetrics for Free?

Enter the URL of Your WordPress website to install ExactMetrics Lite.

Comments

  1. ExactMetrics has made viewing my Google Search Console reports easier and less-confusing for me.

    Thanks for this article.

  2. Thanks for this – adding anything Google is frustrating and time consuming so it’s good to have the steps laid out. It makes it easier to start using ExactMetrics!

  3. I love the idea behind Google Analytics. You all make it possible for creators to understand what their viewers enjoy seeing most from them. Also, thank you for meticulously reviewing the post before publishing it and providing enough detail.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.