Search

How to Add Google Analytics to WordPress

IN THIS ARTICLE

When you add Google Analytics to your WordPress site, it will help you in understanding your audience, improving your website’s performance and growing your website traffic quickly and effectively. Whether you’re working on a simple blog or a professional WordPress website development project, this detailed guide will walk you through the process step-by-step, ensuring you can track your site’s traffic and performance effectively.

Let’s get started to install Google Analytics and see your website grow together!

Methods to Add Google Analytics to WordPress

There are several ways for you to add Google Analytics to your WordPress site. We’ll cover three popular methods for adding Google Analytics by adding the tracking code manually, using the Google Tag Manager and using a plugin.

Method 1: Adding the Tracking Code manually

One of the ways to add the Google Analytics on your WordPress site is by manually adding the Google Analytics tracking code.

1. Sign Up for Google Analytics:

Go to the Google Analytics website and sign up for an account.

Google analytics new account screen

Set up a property for your website by filling basic information such as property name, reporting time zone and currency.

AD 4nXcyj0F3rMoLnqLb2xceq9k3ES3fJmiQ7WIfmWJWO Ogp38TqpTpSIuiDaNZem6urKSs5pQdGvuG24ZN5Y8CRqnIuyQwLNVaG1EJn4fJJIwE5uzsc107Pi5UEMrhywBkj6LnSUCw0QPQnI3KX jiJ2s?key=cdlL UJ8teFyQdzvqrJuUX8n

Source: https://wordpress.com/support/google-analytics/

Provide the information such as business size and category of the industry, which is most likely to be your website name.

Google Analytics screen for adding business information

Source: https://wordpress.com/support/google-analytics/

Select the purpose for using the Google Analytics.

  • Generate Leads
  • Drive online sales
  • Raise brand awareness
  • Examine user behaviour

Accept the terms and conditions for using Google Analytics.

Once accepted, choose the platform for collection of data.

Google Analytics Data Stream setup screen

Source: https://wordpress.com/support/google-analytics/

Choose web option and type the domain name. Do not use www while specifying the domain name. Put your company tagline in the stream name box. Once specified, click on Create Stream button.

Google Analytics web stream setup screen

Once the stream is created, generate the tracking code or tag ID. For this

2. Add the Tracking Code to your Theme:

  • Copy the tracking code provided by Google Analytics.
  • In your WordPress dashboard, go to Appearance > Theme Editor.
  • Open the header.php file and paste the tracking code before the closing </head> tag.
  • Save the changes

Method 2: Using Google Tag Manager

Google Tag Manager allows you to manage multiple tracking codes from a single interface.

1. Set Up Google Tag Manager:

Go to the Google Tag Manager website and create an account.

AD 4nXeTcGRvjsQeV5hwhYc5CRkbq 2nNORIrFYwfXIrIyP47UUrT5mRCuK3XGFfW9CMsrq7W1JyX5ajfVzwvAFR6 b4 ljuHe8qy1sgKAiUZZnukaeY9LpM6e6CwwnEJxOqQCJuX5Rz9pXCzhPNne37mFE?key=cdlL UJ8teFyQdzvqrJuUX8n

Source: tagmanager.google.com

Set up a container for your website and get the container code.

2. Add Google Tag Manager to WordPress:

In your WordPress dashboard, go to Appearance  and select Theme Editor.

Open the header.php file and paste the container code before the closing </head> tag.

A screenshot of a computer

Description automatically generated

3. Add Google Analytics Tag:

In Google Tag Manager, create a new tag.

Install google analytics through tag manager

Source: wpengine.com

Select Google Analytics – Universal Analytics as the tag type.

how to install google analytics on wordpress with tag manager

Source: wpengine.com

Enter your tracking ID and configure the tag to fire on all pages.

Use tag manager to install google analytics on wordpress

Source: wpengine.com

Publish the container.

add google analytics to wordpress with tag manager

Source: wpengine.com

Method 3: Using a MonsterInsights Plugin

For a simple way to add Google Analytics to your WordPress site, follow the below steps to use MonsterInsights plugin.

1. Install and Activate MonsterInsights:

Go to your WordPress dashboard. Navigate to Plugins and click on Add New.

Search for MonsterInsights and install the plugin.

A screenshot of a computer

Description automatically generated

2. Connect MonsterInsights to Google Analytics:

Go to Insights > Settings in your WordPress dashboard.

Click on Connect MonsterInsights.

A screenshot of a computer

Description automatically generated

Follow the on-screen instructions to authenticate your Google account and select the correct property.

3. Configuration of settings:

Once connected, you can configure various settings such as tracking downloads, outbound links, additional plugins, addons and more.

MonsterInsights GA Plugin Recommended Settings

How to view your Google Analytics data?

Once you have set up Google Analytics, you can view the data related to your website by logging into your Google Analytics account. You’ll be able to see various reports on audience demographics, behavior, acquisition channels, and more such information.

Why Use Google Analytics?

Google Analytics provides you details about the audience traffic on your website and their behaviour. Some of the common uses of Google Analytics are detailed below:

  • Track visitor data and user behaviour: Understand who visits your site, your audience’s location, devices they use, which pages are most popular and how long visitors stay etc.
  • Measure marketing performance: Evaluate the effectiveness of your marketing campaigns. This will allow you to decide on your marketing spends and customize the marketing plans accordingly.
  • Improve SEO: Google Analytics helps your identify keywords and content that will drive traffic on your website.

SEO tips for improving Google Analytics performance of your WordPress site

To ensure your website ranks high on search engines, consider the following SEO tips:

  • Use relevant keywords: Use relevant keywords throughout your pages wherever required. However, it should not appear forced application of keywords.
  • Optimize images: Use descriptive file names and alt text for images.
  • Internal linking: Link to other relevant posts on your site to keep visitors engaged.
  • Mobile optimization: Ensure your site is mobile-friendly, as Google prioritizes mobile-first indexing.

Conclusion

Adding Google Analytics to your WordPress site is a simple process that provides you free valuable insights into your website’s performance. Whether you choose to use a plugin, add the tracking code manually, or use Google Tag Manager, connecting your WordPress website to Google Analytics tool will allow you to track your site’s traffic and make data-driven decisions to improve your content and marketing strategies.

However, if you are still having trouble with adding Google Analytics to your WordPress website or do not want to go through the tedious process, reach out to WordPress website development team to solve your problem in a few clicks.

Author

Leave a Reply

Your email address will not be published. Required fields are marked *