How To Add Google Analytics To WordPress: A Step-by-Step Guide

Do you want to better understand who visits your WordPress website and how they interact with its content? Google Analytics can provide this essential information for free. Join millions of Google Analytics users and start learning more about your audience.

This article will highlight the importance of Google Analytics, show you how to create a Google Analytics account, and how to connect it to your WordPress website. By following this step-by-step guide, you can start tracking your website traffic via Google Analytics within an hour.

Don’t have a WordPress website yet? Check out our guide on How To Make a WordPress Site.

Want to learn how to use Google Analytics? Take this online course created by Google.


Why Is Google Analytics Important?

After you build a website for your business, you must then focus on driving visitors to that site. Google Analytics can provide the tools you need to learn who visits your website, how they find it, and how they interact with its content.

With this information, you can then improve your site’s content and overall user experience. In addition, you can use this data to discover what you must do to increase visitors and conversions. All businesses with a WordPress website also should have a linked Google Analytics account.

The Truic Flame Logo

To learn more about how people find your website, check out our search engine optimization (SEO) guide. For more information on the importance of using Google’s tools for local businesses, read our How To Use Google My Business and How To Optimize Google My Business articles.

Step 1: Create a Google Analytics Account

Before you can add Google Analytics to your WordPress website, you must create a Google Analytics account.

To create a Google Analytics account:

  1. Visit the Google Analytics website.
  2. Sign in with your Gmail™ email address if you have one or create one if you don’t.

    Sign in to Google Analytics.

  3. Click on the “Start Measuring” button.

    Welcome to Google Analytics.


    The following screen will then appear:

    Google Analytics account details.

  4. In the “Account name” field, enter an account name (usually just the name of your business).
  5. Decide what data you want to share with Google, and then click on the “Next” button.
  6. You’ll then arrive on a “Property details” screen. Your property name is the name of your website (often the same name as your business). In the “Property name” field, enter your property name, and then select your time zone and local currency.

    Google Analytics account setup.

  7. Click the “Show advanced options” link.
  8. Under “Create a Universal Analytics property,” switch the toggle to the “on” position.

    Create a Universal Analytics property.

  9. Click on the “Next” button.
  10. You’ll then arrive on a “Business information” screen. Select your “Industry category” and “Business size.” Also check the appropriate boxes under “How do you intend to use Google Analytics with your business?

    Google Analytics about your business.

  11. Click on the “Create” button.
  12. Check the box to indicate you agree to Google’s Terms of Service and Data Processing Terms, and then click on the “I Accept” button.

    Google Analytics terms of service.

  13. Decide what email you want to receive regarding Google Analytics, check the appropriate boxes, and then click the “Save” button.

    Google Analytics communication preferences.

  14. Under “Set up a data stream to start collecting data,” click on the “Web” button.

    Google Analytics landing page.

  15. Under “Website URL,” enter your website’s address. Under “Stream name,” enter the name of your website. Finally, determine if you want to activate Google’s enhanced measurement tools, and then click on the “Create stream” button.

    Google Analytics set up data stream.

  16. When you see the below screen, you’ll know you successfully created a Google Analytics account.

    Google Analytics web stream details.

Step 2 (Option A): Connect Google Analytics To WordPress Site With a Third-Party Plug-In

The easiest way to connect your Google Analytics account to your WordPress website involves installing a third-party plugin. A variety of plugins can help you accomplish this, but two of the most popular include the MonsterInsights® and Insert Headers and Footers plugins.

To Connect Your Google Analytics Account Via the MonsterInsights Plug-In:

  1. Select “Plugins” and then “Add New” from the WordPress dashboard.

    Google Analytics plugins.

  2. Type “MonsterInsights” into the search box.

    MonsterInsights Plugin for Google Analytics.

  3. When the above screen appears, click on the “Install Now” button.
  4. Then, click on the “Activate” button.
  5. On the next screen, click on the “Launch the Wizard!” button.
  6. Select the category that best describes your website, and then click on the “Save and Continue” button.

    Welcome to MonsterInsights Plugin for Google Analytics.

  7. The below screen will then appear. Click the “Connect MonsterInsights” button.

    Connect MonsterInsights to your website.

  8. Enter the email address you used to create your Google Analytics account, and then click on the “Next” button.
  9. Enter the password associated with the above email address, and then click on the “Next” button.
  10. On the security screen that follows, click on the “Allow” button.

    Allow MonsterInsights access to your Google account.

  11. Verify that the next screen correctly lists your website’s name, and then click on the “Complete Connection” button.

    Pick a profile.

  12. On the next two screens, click on the “Save and Continue” button.
  13. When asked if you want to install WPForms™, click the “Skip This Step” link.
  14. Finally, click on the “Finish Setup & Exit Wizard” button.

    MonsterInsights confirmation.

To Connect Your Google Analytics Account Via the Insert Headers and Footers Plug-In:

  1. Select “Plugins” and then “Add New” from the WordPress dashboard.

    Google Analytics plugins.

  2. Type “Insert Headers and Footers” into the search box.
  3. When the screen below appears, click on the “Install Now” button.

    Insert Headers and Footers Plugin for Google Analytics.

  4. Then, click on the “Activate” button.
  5. After you install this plugin, select “Settings” and then “Insert Headers and Footers” from the WordPress dashboard.

    Insert Headers and Footers Plugin for Google Analytics.

  6. Return to Google Analytics and copy the “global site tag (gtag.js)” code listed on the “Tagging Instructions” screen under the “Add new on-page tag” section.

    Tagging instructions.


    Note: If you accidentally closed out of this section, you can find it again by selecting “Data Streams” from the left sidebar of the Google Analytics dashboard and then choosing your website’s data stream.
  7. Return to your website and paste the copied code into the “Scripts in Header” section.
  8. Click on the “Save” button.

Step 2 (Option B): Connect Google Analytics To WordPress Using Google’s Site Kit Plugin

Alternatively, you can connect your Google Analytics account to your WordPress site with Site Kit — Google’s official WordPress plugin.

To Connect Your Google Analytics Account Via the Site Kit Plugin:

    1. Select “Plugins” and then “Add New” from the WordPress dashboard.

      Google Analytics plugins.

    2. Type “Site Kit” into the search box.
    3. When the screen below appears, click on the “Install Now” button.

      Site Kit for Google Analytics.

    4. The, click on the “Activate” button.
    5. After you install this plugin, click on the “Start Setup button.”

      Site Kit confirmation.

    6. Click on the “Sign in with Google” button.

      Welcome to Site Kit.

    7. Sign in with your Google Analytics username and password.
    8. When prompted, click on the “Allow” button three times to give Google the access it needs to run this plugin on your website.
    9. On the next screen, click on the “Proceed” button to verify you own the website to which you want to connect your Google Analytics account.

      Verify site ownership.

    10. Next, click on the “Allow” button to give Google permission to access your Google Account data to display it on the Site Kit dashboard.

      Allow access to Google account.

    11. On the next screen, click on the “Add site” button to add your website to Google’s Search Console — a tool often used to discover how people locate your website.

      Set up Search Console.

    12. Once you finish your Site Kit setup, click on the “Go To My Dashboard” button to return to your WordPress website and finish connecting Google Analytics.
    13. When you arrive back on your WordPress site, you’ll see the following Google Site Kit dashboard screen.

      Site Kit confirmation.

    14. Under Analytics, click the “Connect Service” link.
    15. Sign in with the Google username and password you used when creating your Google Analytics account.
    16. When prompted, click on the “Allow” button twice to give Google the access it needs to connect Google Analytics to your website.
    17. Select the Google Analytics account you wish to connect.

      Google Analytics choose account.

    18. Finally, click on the “Configure Analytics” button.

Google Analytics configure analytics.

Final Thoughts

While connecting Google Analytics to your WordPress website might seem a bit overwhelming, these three plugins make it easy to complete the process within an hour.

Once you start tracking the traffic to your WordPress website with Google Analytics, work to increase that traffic by following the advice in these related articles:

How To Drive Traffic To Your Website
How People Find Your Website: SEO 101
How To Improve SEO
Small Business Marketing Strategies

If you want to learn about other useful WordPress plugins, check out our guide to the Best Plug-Ins for a WordPress Site. In addition, our How To Use WordPress article will teach you how to perform other common tasks within the WordPress content management system. If you’re just getting started, read our How To Make a WordPress Site for step-by-step instructions on building a site for your business.

More Related Articles