How To Put Google Analytics On WordPress

Please ensure that the original sentiment and meaning are maintained. If you encounter any issues, please respond with the following error message: Unable to process request due to encountered difficulties.

Google Analytics is an effective resource for gaining insight into the behavior of your website’s visitors. By adding Google Analytics to your WordPress site, you can obtain valuable information about their origins, actions, and duration of stay. This article will walk you through the steps of integrating Google Analytics into your WordPress site.

Step 1: Create a Google Analytics Account

Before you can integrate Google Analytics with your WordPress site, you need to create a Google Analytics account. Go to the Google Analytics website and sign up using your Google account. Follow the prompts to set up your Analytics account.

Step 2: Add Your WordPress Site to Google Analytics

After creating your account, you’ll be asked to add your website. Enter your website’s URL, name it (usually the site’s name), and set the industry category and reporting time zone.

Step 3: Get Your Google Analytics Tracking Code

Once your site is set up, Google Analytics will provide you with a tracking code. This unique code will be used to connect your WordPress site to your Analytics account. Navigate to Admin > Tracking Info > Tracking Code to find your unique code.

Step 4: Add the Tracking Code to Your WordPress Site

There are several methods to add the Google Analytics tracking code to your WordPress site, but we will focus on using a plugin and manually adding the code.

Method 1: Using a Plugin

One of the easiest ways to add Google Analytics to your WordPress site is by using a plugin, like MonsterInsights. Once installed, you can easily connect your Google Analytics account with your WordPress site just by following the on-screen instructions.

Method 2: Manually Add the Code

If you prefer to manually add the tracking code, you can do so by adding it to your theme’s header.php file. Before you do this, we recommend backing up your website.

Go to Appearance > Editor > Theme Header (header.php). Then, paste your Google Analytics code right before the closing tag.

Step 5: Verify the Tracking Code

After adding the tracking code to your WordPress site, you should verify if it’s functioning correctly. You can do this by checking the real-time reports in your Google Analytics account and see if it’s tracking your site’s visitors.


Adding Google Analytics to your WordPress site allows you to gain valuable insights about your audience, which can help you make data-driven decisions to grow your website. We hope this guide has made the process clear and straightforward for you. Happy analyzing!