Google is pushing GA4 hard.

Not just new users but also existing web admins too.

If you’re already an analytics user, you have seen something like this on your dashboard in the last couple of months.

Ever wonder why?

That’s because privacy policy has become a priority for Google. And they are slowly shifting to a cookieless world.

On 16th March, Google announced they would no longer support Universal Analytics from 1st July 2023 and moved everyone to Google Analytics 4.

So whether you’re new or have already been using universal Analytics, you need to switch to GA4. Wondering How do I add Google Analytics 4 tracking to my website?

Let’s learn how to add google analytics 4 to WordPress and get more accurate reports of your users.

How to add Google Analytics 4 to WordPress

  • Step 1: Create a new Google Analytics 4 property
  • Step 2: Get your GA4 tracking code
  • Step 3: Add the tracking code to your website

Step 1: Create a new Google Analytics 4 property

I assume you’ve already used the older universal analytics. In that case, switching to the new GA4 will be a smooth process. Let’s get things done together.

Go to the main Google Analytics Account

 Login to your Google account. If you log in success, it will take you to the main dashboard.

Create a New Google Analytics 4 Property

You can create a new property in 2 ways.

If you’re an existing user and haven’t set up the GA4, then the dashboard will show something like this-

Click “complete GA4 Setup”; it will take you to the property section.

Another way is to go to Admin. The universal analytics will take you to the property section.

Go ahead; you will see three columns here- Account, Property and View. Click the Property section.

Next, click the GA4 setup assistant. This will give you 2 options, you can create a new property 4, or you can connect with the existing one.

  • For a new one, click “I want to create a new Google Analytics 4 property” box, and click on “Get started”. You need to connect properties manually.
  • And for the existing one, just click “Get started”.

Once the process is complete, you will see something like this-

Step 2: Collect the GA4 tracking code

After a successful property setup, we have to get the tracking code to place it on WordPress. The good news is it’s also in the same property section. Here is how to get the code-

Go to tag installation and see your tracking code. In the meanwhile, you will see the “Data stream” button under the Property access management section. Select the Web option, and there you have something like this-

Click the Global site tag (gtag.js) option on Tagging instruction Section. Here You’ll now notice your GA tracking code. And this is the code we need to be added to your WordPress site.

Step 3: Put the tracking code on WordPress

The main part!!!

But Where to insert the GA4 tracking code?

The Analytic will give you 2 options to do it. You can add the code manually or use one plugin, sitekit or MonsterInsights.

Adding tracking code manually-

  1. Log in to your WordPress admin dashboard 
  2. Go to appearance>theme file editor
  3. In the right corner, you will see the header PHP option
  4. Paste the code on the box
  5. Click on the “Update file” option at the bottom.

Adding the code with Sitekit

If you already install Sitekit, then the rest of the process is too simple. Just click Set up Now.

If the sitekit is not already installed, then here is the process-

  1. GO to the dashboard.
  2. Click plugin> Install SiteKit
  3. Connect with the Analytics
  4. Verify the site ownership
  5. Allow setup search console & click next
  6. You’ll see that google analytics is automatically selected
  7. Click GA4 property and configure Analytics
  8. Give additional permission
  9. Congrats on the setup of Analytics

GA4 vs UA: What’s Different between Google Analytics 4 and Universal Analytics?

GA4 is the future of Google Analytics.

The new GA4 is more event-based and focuses more on user privacy. Here are some key differences of these two-

  • The data model is Events-based: GA4 uses an event-based data model, which means that events are the primary unit of measurement. Events can include page views, clicks, and more. On the other hand, universal analytics was primarily focused solely on pageviews and sessions.
  • App and Web Tracking: That’s probably the best feature of the new GA4. It combines app and web tracking into a single platform. That means you can track and analyze data from both your website and mobile app in one place.
  • New user snapshot – The reporting interface of new users in GA4 differs from UA. GA4 has a more streamlined and user-friendly interface with updated reports about new users.

 Now the main question- Can I add Google Analytics 4 to WordPress for free? Yes, it’s absolutely free.