Skip to content

How to Add Google Analytics GA4 to WordPress

How to Add Google Analytics to WordPress

To add Google Analytics in WordPress is actually quite easy, but what is a little more difficult is to create a Google Analytics account for our website. As we know, currently the latest Google Analytics, namely GA4, will officially replace the existence of Universal Analytics which is planned to be stopped by Google in 2023.

If we are used to using the old Google Analytics, namely the Universal Analytics version, then to make the latest Google Analytics GA4 will be a little different. Even so, inevitably we have to switch to GA4 if we want to use Google Analytics for a long time in the future. GA4 certainly has new features that previous versions of Universal Analytics didn’t have. The following are some of the new features of Google Analytics GA4.

Google Analytics GA4 Features

  • Using AI to perform analysis
  • Easily categorize visitors
  • Easy to create detailed reports that can be customized
  • Can detect anomalies that occur on the website
  • Data streams and real-time to report the number of website visitors
  • Can be used to detect user experience across different devices

What is it necessary to use Google Analytics for?

By using Google Analytics, of course we have a lot of data that we can ultimately use as a basis to maximize the performance and goals of our website such as maximizing conversions, increasing revenue, or to get data on what is most in demand on our website.

How to Add Google Analytics to WordPress

It should be noted that Google Analytics itself should be placed on all pages of the website, this is so that the data entered into the Google Analytics report becomes more complete.

By using WordPress we can easily enter the Google Analytics code because there are many plugins that we can use. Plugins that are often used to add Google Analytics are SEO-related, such as Seopress, Yoast, Rankmath, and also the All in One Seo Pack.

Actually, if the WordPress theme you are using provides a custom field to add HTML/JavaScript code, you don’t need to install any plugins and put Google Analytics code in that field. But here I will use the Seopress plugin because of its ease and lightness. Here’s a guide to adding Google Analytics in WordPress.

  1. Go to your WordPress dashboard and go to the Plugins > Add New menu. Type “seopress” in the search field, if you have found click “Install Now“, then click “Activate“, so that your Seopress plugin will be successfully activated.
How to Add Google Analytics to WordPress - Step 1
How to Add Google Analytics to WordPress – Step 1
  1. Once your Seopress plugin is active, go to the SEO > Analytics menu in the left-hand menu of your WordPress.
How to Add Google Analytics to WordPress - Step 2
How to Add Google Analytics to WordPress – Step 2
  1. Make sure that the Analytics feature is enabled, then check the option “Enable Google Analytics tracking (Global Site Tag: gtag.js)“, and enter your measurement ID (GA4) code into the “Enter your measurement ID (GA4)” field. After you fill in click “Save changes“.
How to Add Google Analytics to WordPress - Step 3
How to Add Google Analytics to WordPress – Step 3
  1. If you don’t have a measurement ID (GA4) code yet, then you can create one for your WordPress domain, please go to https://analytics.google.com/analytics/web.
  2. You will be directed to create a Google Analytics Account if you have never created one, if you have had a Google Analytics account before you can click on the “Create Account” option.
How to Add Google Analytics to WordPress - Step 4
How to Add Google Analytics to WordPress – Step 4
  1. Fill in the Account name option, give it a name similar to the domain so that it is easy to identify. Then check all the options on the “Account Data Sharing Settings“, and click the “Next” button.
How to Add Google Analytics to WordPress - Step 5
How to Add Google Analytics to WordPress – Step 5
  1. Fill in the Property name with your domain name, select the time zone and currency according to your wishes, then click “Next“.
How to Add Google Analytics to WordPress - Step 6
How to Add Google Analytics to WordPress – Step 6
  1. Fill in your business information then click “Create“.
How to Add Google Analytics to WordPress - Step 7
How to Add Google Analytics to WordPress – Step 7
  1. Read and agree to all the terms then click “I Accept“.
How to Add Google Analytics to WordPress - Step 8
How to Add Google Analytics to WordPress – Step 8
  1. On the platform select “Web“.
How to Add Google Analytics to WordPress - Step 9
How to Add Google Analytics to WordPress – Step 9
  1. Enter your web domain, name it “Stream name“, then click “Create stream“.
How to Add Google Analytics to WordPress - Step 10
How to Add Google Analytics to WordPress – Step 10
  1. Copy your “MEASUREMENT ID“, and paste it in the Seopress plugin under the Analytics option in your WordPress dashboard, then click “Save changes“.
How to Add Google Analytics to WordPress - Step 11
How to Add Google Analytics to WordPress – Step 11
How to Add Google Analytics to WordPress - Step 12
How to Add Google Analytics to WordPress – Step 12
  1. Google Analytics has been successfully added to your WordPress, to verify whether the code is installed please open the front page of your website, then click the “Ctrl+U” button on your keyboard at the same time, then find the “MEASUREMENT ID” code by pressing the “Ctrl+F” key on your keyboard, and paste your “MEASUREMENT ID” code, if it already exists it means that the Google Analytics code was successfully added.
How to Add Google Analytics to WordPress - Step 13
How to Add Google Analytics to WordPress – Step 13

FAQ

Is the Google Analytics code placed in the Header/Footer?
You can put the Google Analytics code in the Header or Footer of your WordPress website.

Will Google Analytics make the website slow?
Comparatively, of course a third-party code installed on the website will have little effect on website speed.

Can Google Analytics code be used over a domain?
We recommend that you separate the properties in this case the domain and not use the same Google Analytics code on several websites.

How to Add Google Analytics to WordPress in Video

For those of you who have difficulty implementing a guide on how to add Google Analytics to WordPress in writing format, then you can watch the guide in the form of the following video.

How to Add Google Analytics to WordPress in YouTube

Leave a Reply

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