Set up Google Analytics in WordPress

How do I integrate Google Analytics in the WordPress CMS system?

There are several ways to do this. In general, a distinction is made between plug-in solutions and manual integration. I will present you both options and my plugin recommendations for them in this article.

Data is the new gold, so it is essential that you also set up Google Analytics correctly in your WordPress.

Startseite » Webanalytics » Google Analytics » Google Analytics WordPress

What is Google Analytics and why do I need it?

Google Analytics is a tool for analyzing your website visitors and their actions on your site. Here you can find a detailed report on Google Analytics.

Abstract: You integrate a so-called tracking code on your WordPress website and it collects data which is sent to Google Analytics.

In Google Analytics, you will then have 5 categories to choose from, where you can analyze your data accordingly:

  • Real-time: Shows what is happening on your website at the moment you are viewing the report.
  • Audience: Contains information about who visits your website, including demographic data.
  • Acquisition: Overview of the different traffic sources.
  • Behavior: An overview of the most important pages and user paths.
  • Conversions: Here you can record target conversions and e-commerce tracking.
Google-Analytics-Berichtübersicht

Why is Google Analytics important for your WordPress website?

As written in the introduction, your data is the new gold for you and your online success.

Important reasons why you should set up Google Analytics for your WordPress are the following:

Review of goal achievement: The first consideration you should make about your website is what goal am I pursuing with it? Is it sales in your online store? Are they inquiries about your service? Is it traffic?

You can only answer these questions with an appropriate tracking system.

Monitoring of marketing activities: If you run Google Ads, Microsoft Ads or Display Advertising for your website, you probably also want to check what benefit this spending has? This is exactly where Google Analytics for WordPress comes into play.

Analysis of your target group: Via the demographic reports in Google Analytics, you can draw conclusions about your target group.

But now that we’ve talked around the topic enough, let’s turn our attention to the ways in which you can now add Google Analytics to WordPress.

How do I install Google Analytics in WordPress?

Now there are several ways to do this here. Here it is important to note that you use as “lean” plugins as possible for integration, since every plugin naturally also has a negative impact on the loading time.

I’m glad you decided to read this article, because of course I’m going to present you only the best plugins for this integration.

Before we start with the plugins, I’ll show you where you can read out the so-called tracking ID for your Google Analytics.

  1. To create Google Analytics, you need a Google account.
  2. If you already have an account or have created one now, go to the Google Analytics page.
  3. There you can either create a new property or query the code of an existing one.
  4. You can easily query the code of an existing property via Administration / Property Settings / Tracking ID
  5. For a new installation, click Create Property and follow the Google wizard to install. At the end you will receive the tracking ID, which you will need for the following topics.
google-analytics-property

1. installation Google Analytics with a plugin

Site Kit by Google

Site Kit is the official Google WordPress plugin. You can connect your website to 6 Google services: Search Console, Adsense, Analytics, PageSpeed Insights, Optimize and Tag Manager.
 
Once you’ve given Google permission to access your site, you’ll see a new Site Kit administration menu in the WordPress admin panel, and a separate page for each module you’ve enabled.
 
Beyond connecting your website, there are not many settings to configure. Site Kit automatically adds the Google Analytics tracking code to your website and if it has already been added, it will not be added again, of course.
site-kit-google
Site Kit is a simple solution if you want to integrate all other Google services at the same time. It is important to know here that there is also a dashboard in WordPress with your access data. but you can query all other data directly in Google Analytics.
 

MonsterInsights

With over two million active installs, MonsterInsights is by far the most popular Google Analytics WordPress plugin on the market.
 
You can view detailed statistics directly from the WordPress admin panel and add additional tracking for popular e-commerce WordPress plugins like WooCommerce, Easy Digital Downloads and MemberPress.
 
When you activate MonsterInsights for the first time, you will be guided through the initial setup with a user-friendly “Startup Wizard”. After giving MonsterInsights permission to access your Google Analytics account, you can choose which website profile you want to access.
 
monsterinsights-google-Analytics

GA Google Analytics

If you don’t need a dashboard in WordPress, but just want to define what should be tracked, then GA Google Analytics is the plugin for you.
 
Developed by WordPress veteran Jeff Starr, the plugin allows you to integrate Google Analytics into your website by simply providing your GA tracking ID.
 
With GA Google Analytics, you can also add improved link attribution, IP anonymization and forcing SSL. There is also an option to add custom code.
 
Just add your tracking ID in the corresponding field and you have Google Analytics integrated.
ga-google-analytics

2. installation of Google Analytics with Google Tag Manager

If you don’t want to use any of the above plugins, you can of course install Google Analytics with Tag Manager.

Here I have an article that explains each step in Google Tag Manager to install Google Analytics.

Like Google Analytics, Google Tag Manager requires a tracking code on your website.

Integration of Google Tag Manager with a plugin

Here I can recommend you the Google Tag Manager for WordPress plugin. You just need to install the plugin and add the Google Tag Manager ID in the plugin. The advantage here is that the plugin takes care of the complete configuration of the so-called data layer and you don’t have to do anything else. So my clear recommendation for beginners. 

More about how Google Tag Manager works.

3. installation of Google Analytics without plugin

If you don’t want to use a plugin, you can simply integrate the Google Analytics tracking code directly into your WordPress template.

This option is for advanced users only and should be used with caution.

To do this now, you can go directly to WordPress / Design / Theme Editor and there implement the tracking code in your template under Theme Header (header.php).

wordpress-theme-header

Google Analytics and privacy

It is important that you use Google Analytics in a privacy compliant manner. You can do this either via a consent tool like CookieBot or my recommendation for WordPress: Borlabs.

This was the article about Google Analytics for WordPress

Below you can find more interesting articles about web analytics & tracking.

Share article!

Marc Heiss

Author: Marc Heiss
Position: Management
Updated: 27.02.2021

Helpful Topics Around Web Analytics & Tracking