Google Analytics Glossary

Add Google Analytics to Wordpress

Image of Iron Brands

Published on Nov 23, 2023 and edited on Apr 7, 2024 by Iron Brands

Google Analytics can help you expand your audience by analyzing traffic and user engagement for your website. This blogs will explain how to add Google Analytics to your WordPress website, step by step.

Let's dive in!

  1. Setting up Google Analytics property
  2. Method 1: Using a Plugin
    1. Choose a Plugin
    2. Install and Activate the Plugin
    3. Configure the Plugin
    4. Verify the Setup
  3. Method 2: Manually Adding the Tracking Code
    1. Get Your Google Analytics Tracking Code
    2. Insert the Code into WordPress
    3. Test Your Integration
  4. (Optional) Create New Properties
  5. Final Thoughts
Logo of MichelinMichelin chose Simple AnalyticsJoin them

Before we dig in I want to show you something. I promise it's worth it...

Google Analytics is great, but also complex and a bit clunky. If you just want a straightforward dashboard with the insights you need, GA is not a great place to start. Additionally, Google doesn't care about privacy and GA requires an annoying cookie banner.

That's why I built Simple Analytics, a privacy-friendly and simple analytics tool - no personal data, no cookies, just the insights you need in a straightforward dashboard.

Here is how it looks vs GA. Feel free to check our live analytics to get an idea for your project. (It is free btw)

All right, enough about us. Now let's get into answering your question!

Can you spot the difference between the dashboards?

Setting up Google Analytics property

Any integration starts by propertly setting up GA:

  • Log into your GA account (or create one, if you haven't already).
  • Create a GA property for your app.
  • Inspect your property and note its Measurement ID. You will need this ID later.

Method 1: Using a Plugin

Choose a Plugin

There are multiple WordPress plugins available for integrating GA, like 'MonsterInsights', 'ExactMetrics', or 'GA Google Analytics'. These plugins simplify the process and often add extra features for data visualization within WordPress.

Install and Activate the Plugin

Navigate to your WordPress dashboard, go to 'Plugins' > 'Add New', search for the chosen plugin, and install it. Once installed, activate the plugin.

Configure the Plugin

After activation, the plugin will typically guide you through connecting it to your Google Analytics account. This often involves authenticating with your Google account and entering your Measurement ID.

Verify the Setup

Check your Google Analytics dashboard to ensure data is being received. This may take some time to show up.

Method 2: Manually Adding the Tracking Code

Get Your Google Analytics Tracking Code

In your Google Analytics account, locate your GA property and find your "Measurement ID".

Insert the Code into WordPress

There are a few places you can add this code:

  • Theme Header: Go to 'Appearance' > 'Theme Editor', find the header.php file, and insert the tracking code before the closing </head> tag.
  • Using a WordPress Hook: If you're comfortable with coding, use the wp_head action hook to insert the tracking code into your theme's functions.php file.
  • Using a Site-Wide Code Injection Plugin: If you're not comfortable editing theme files, use a plugin that allows you to insert headers and footers or custom scripts.

Test Your Integration

Check your Google Analytics dashboard to ensure data is being captured. You can use tools like the Google Analytics Debugger for Chrome for debugging.

(Optional) Create New Properties

Whether you are using a plugin or adding the code manually, you will need create more GA properties and use the corresponding Measurement IDs to track multiple websites. This prevents GA from conflating the data.

Final Thoughts

Adding Google Analytics to your website can give you great insights. However, ask yourself: is Google Analytics the right tool for you?

GA is an overpowered solution for straightforward analytics. If you're looking for a simple and intuitive dashboard with the insights you need, there are better alternatives. Yes, I’m talking about my own product (Simple Analytics), but there are others out there as well.

I hated using Google Analytics for my projects. It's clunky, there are hundreds of dashboards and it doesn't look appealing. Also Google doesn't care about privacy or ethics. That's why I decided to build my own and more intuitive web analytics tool.

If this resonates with you, feel free to give Simple Analytics a spin. You just need to add the script to your website and off you go. This takes about one minute- and there is a free version as well!

Enjoy!

GA4 is complex. Try Simple Analytics

GA4 is like sitting in an airplane cockpit without a pilot license

Start 14-day trial