Google Analytics 4 for Authors: WordPress

Google Analytics 4 for Authors: WordPress

You’re not tech-savvy. Maybe you are. Either way, you need to set up Google Analytics 4 for your website. Knowing how your users engage with the content on your website can help you greatly improve on marketing campaigns focused on blog posts, pages, or maybe your books.

In this post, I’m only covering how you can install the Google Analytics 4 tracking code. I’ll include setting up specific click tracking in a future post.

What is Google Analytics 4, though?

Google Analytics 4 is a powerful marketing tool for insights that will help you make better marketing decisions.

Let’s not waste any more time…

How To Install Google Analytics 4 On Your Website

Thankfully, configuring GA4 is as simple as a few clicks.

First, go to ““. Next, click “Start Measuring”. The next few steps are simply for naming the property and the URL of the website you want to be tracked.

After you finish setting up the basic details of your website, you should come to a screen similar to the one below:

Next, click on “Global site tag (gtag.js)”. You should see something similar to the image below:

Copy and paste this code inside the “header.php” file in your theme file editor.

In the WordPress Dashboard, hover your mouse pointer over “Appearance”.

Next, click on “Theme File Editor”.

In the “Theme File Editor”, locate “header.php” in the “Theme Files” directory on the right-hand side.

Use the image below to determine where you should paste the tracking code and click “Update File”:

Confirm The Tracking Code Is Working

To confirm the tracking code is working go back to your Google Analytics 4 property and click “Reports”, then “Realtime”. Sometimes, it can take a few minutes to 48 hours at minimum before you start seeing any data.

Once you start receiving data, you’ll see page names, blog post titles, and more from the “Engagement Overview” report.

If you have any questions, please put them in the comments below.