How To Add Google Analytics To WordPress?

Do you want to know “How to add Google Analytics to WordPress Website”?

Every website owner wants to check:

  • visitors location
  • bounce rate (for how much time they stay on your website)
  • return visitors
  • organic, direct, or social visitors
  • which page/post do they visit the most
  • and many other things…

You can check all these and more with the help of the free tool “Google Analytics”.

So, today I am going to help you add Google Analytics to WordPress website.

Don’t worry it’s easy to set up, just follow the article till the end. 

How to install and add Google Analytics to WordPress?

Google Analytics is a powerful tool that provides valuable insights into your website’s performance, visitor behaviour, and marketing effectiveness.

Integrating it with your WordPress site allows you to track important metrics and make data-driven decisions to enhance your online presence.

In this guide, I will walk you through various methods and plugins to seamlessly incorporate Google Analytics into your WordPress site.

Let’s explore the different options to add Google Analytics to WordPress.

1. Create an account with Google Analytics

First of all, you need to visit Google Analytics and sign up with your Google account.

setup Google Analytics account

create Google Analytics account

Fill up your account name (anything you want) then click all the checkboxes and be done.

Let’s move on to the second step.

select Google Analytics web

Now in the next step, you can see 3 things:

  1. WEB – If you want to check stats for your website then click here.
  2. APPS – This option is for app owners who want to check the statistics of their apps.
  3. APPS & WEB – This option is for both website and app owners.

For now, we are here to check website stats, so click on the WEB and come to the next step.

Google Analytics create account

In this last step, you have to enter your website details.

Website name – You can fill up anything you want.

Website URL – Enter your URL with Http/Https.

Industry category – Choose your website category.

Reporting Time Zone – Your country’s time zone or whatever you want.

Google analytics terms of service

Read their terms and conditions, click them and continue.

Google Analytics tracking code

On the next page, you will get your tracking ID and code.

Copy the tracking ID for later.

You can use the code to enter manually in the header or footer, but I prefer to use the tracking ID with the help of these two plugins or a theme for better results:

  1. MonsterInsights
  2. CAOS
  3. Themify Ultra Theme

2. Connect with MonsterInsights

First, you need to activate and install the plugin.

monster insights settings

monster insights settings

Settings – General

You can connect Google Analytics with MonsterInsights or manually enter your tracking ID.

I prefer manually entering the tracking ID otherwise you can check both.

monster insights settings

monster insights settings

Engagement

Here you can enable or disable demographics or link attribution settings.

You can also add a URL for cross-domain tracking.

Do these settings as per your need.

Leave blank or default if you don’t know about these options.

monster insights settings

monster insights settings

monster insights settings

eCommerce, Publisher & Conversions are premium options for which you have to pay. So leave this for now.

monster insights settings

monster insights settings

monster insights settings

Here you can give user role permissions to see reports, save settings, and exclude them from tracking.

Enable or disable the dashboard widget and reports.

Show or hide admin bar reports.

Enable or disable automatic updates.

Show or hide announcements.

Allow or disallow usage tracking.

3. Connect with CAOS (Host Google Analytics locally)

This plugin hosts google analytics locally which means your page speed/performance is not affected by external requests.

This plugin can create a folder anallytics.js which you can cache and optimize.

Activate and install the plugin.

Google analytics caos settings

Enter your Google Analytics tracking ID.

Allow tracking – always

Snippet type – default

Enable compatibility mode – Leave blank or choose MonsterInsights if you want both plugins.

Stealth mode – disable

Which file to download – analytics.js 

Save analytics.js to – leave this as it is

Google analytics caos settings

Position of tracking code – Header 

Serve from a CDN – if you are using CDN then enter the URL here otherwise leave blank. (not for Cloudflare users)

Capture outbound links – this is used to track “when users leave your site or click on outbound links on your site”.

This only works if you choose the analytics.js file for download and disable stealth mode.

Cookie expiry period – you can set a cookie (in days)

use adjusted bounce rate – for now, leave this blank 

Change enqueue order – 0

Disable all display features functionality – leave

Google analytics caos settings

Anonymise IP – disable

Track logged-in administrators – disable

Remove settings at uninstall – Enable if you want all the settings to be removed after the uninstallation.

Save changes and done.

4. Themify Ultra

If you are using the Themify Ultra theme (recommended), then you can directly add the Google Analytics code to the theme settings.

No need to install an extra plugin and load your server.

Google analytics themify ultra settings

Click on Themify Ultra – Themify settings – General – Google Analytics.

Add the code and save – done.

Easy and Simple, right?

[wpdatatable id=88 table_view=regular]

[wpdatatable id=72 table_view=regular]

5. How to Check Stats?

After all the steps are done, wait for a few hours for Google Analytics to analyze and collect the data.

  1. You can check your stats in your admin dashboard with MonsterInsights.
  2. Or visit the Google Analytics site directly.
  3. Or download the Google Analytics app on your mobile and log in with the same ID to check the stats directly on your mobile.

Wrapping Up – Add Google Analytics to WordPress

Adding Google Analytics to your WordPress website is a fundamental step in understanding your site’s performance and user behaviour.

Google Analytics provides a powerful tool for website owners, enabling them to track their progress and adapt their strategies to achieve their online goals.

So, don’t delay – take advantage of this valuable resource and start using Google Analytics for your WordPress site today.

People also search for:

  1. Improve User Experience: Addressing Broken Links
  2. Improve User Experience: Best TOC Plugins for WordPress
  3. Simple Speed Boost: WP Optimize Plugin Configuration
  4. SiteGround Optimization Made Simple: Configuration Tips
  5. Easy Performance Boost: Autoptimize Plugin Settings