Add Google Analytics 4 to WordPress

Add Google Analytics 4 to WordPress

On October 14th, 2020, Google released Google Analytics 4, also called GA4. This is being referred to as their “next generation analytics.” You may have previously known it as App > Web property, within your Google Analytics account.
Before you add this new Google Analytics to WordPress, it is important to know how beneficial having analytics on your WordPress site is. Analytical data and traffic numbers coming from your site can give you insights into all sorts of numbers that can be used for marketing, interaction, SEO, social media, and more.

Why Add GA4 to WordPress?

As stated above, the importance of Google Analytics and the data it can provide you can’t be overstated. For that reason, when Google releases big updates or versions of Analytics, it is important to upgrade and give your website all of the latest benefits that come with the update.

For example, the Google Analytics 4 update brought with it 4 really great features that everyone can take advantage of. These include:
  • Smarter Insights
  • Deeper Integration with Google Ads or Adwords
  • Customer-Centric Data Measurement
  • More Data Controls
These are important tools you can take advantage of and really help get your site marketing to the next level.

Note: The rest of this tutorial assumes you already have Google Analytics set up on your WordPress website. 

Add GA4 to WordPress

Step 1: Go to Your Google Analytics Account

Go ahead and start the process by heading over to the Google Analytics homepage and login with your Google account. This gives you access to your dashboard and we can move forward from there.

Step 2:  Create a New Google Analytics 4 Property

Now that you are inside your Analytics dashboard, you want to create a new GA4 property. You can either click on Admin > Create Account, or select an existing account that you want to set up your new property on.

Since this tutorial assumes you already have a Google Analytics account, we are going to simply click on “Create Property” on an existing account.

Create New google analytics 4 account or new property

Step 3: Add All Property Details 

Clicking on the “Create Property” button will take you to the Property Details page. Here, you can add all the relevant property information needed.

Go ahead and name your property, report a time zone, and add any other relevant details that are needed. You set this up how you see fit.

Google Analytics 4 property details

When you are finished, click on the “Next” button to move forward. This takes you down to a few more details you may want to add. This includes business size and a couple of other questions. You can fill this out how you see fit.

When you are done, click on the “Create” button at the bottom of the page.

Click on the create button

Step 4: Select “Web” Option

At this point, you will be on the “Data Streams” page. You will see that there are three different options available. iOS App, Android App, and Web. Select “Web.”

Select the web option

Step 5: Set Up Web Stream

When you click on the Web option, a screen pops out to allow you to set up your web stream. Go ahead and fill out all the relevant information to create the stream. This includes adding your URL, giving your stream a name, and adding or subtracting any enhanced measurements you want.

Click on the “Create Stream” button when you are finished.

Set up web stream

Step 6: Connect Your Existing Analytics Property to GA4

Go back to your existing UA property by clicking on the Admin button and then select your UA Property from the drop-down.

Select google analytics 4 property from dropdown

Now, click on the “Tracking Info” option, and in the dropdown menu select “Tracking” code.

Tracking info then tracking code

On the screen that pops out, copy your tracking code so that you can have it.

Copy the tracking code

Finally, switch back to your new GA4 Property by selecting the new GA4 Property from the drop-down. Then click on the stream you created above, and look for “Connected Site Tags.” Click on it.

Click on connected site tags

Enter or paste the tracking ID that you copied above, give it a nickname, and then click on “Connect.”

Enter ID and nickname and click connect

Step 7: Install Tracking Code on Your WordPress Website

You have now made it to the last step of the process. You need to install the tracking code on your WordPress site and then you will start receiving all the data and analytics that come with Google Analytics 4.

From your web stream, click on the “Add new on-page Tag” option and Select Global Tag (gtag.js).

Global ID tag

Copy the tracking code. Now let’s head to your site and add the code.

Note: In this case, we are using a WordPress website. You can enter the code into the “head” section of your website. Again, you can go straight into the theme options and add the code, or you can do it by using a plugin that gives you easy access to add code to the head. Either way is fine.

Log in to your WordPress admin dashboard and paste the code into the head of your site as described in the note above. Click on the “Save” button to save your code.

You can do this by using a plugin like Insert Header and Footer. This lets you place code directly into those sections of WordPress. Or you can manually place the code into your site files.

That’s it. You should now be running Google Analytics 4 on your site and you will start to see those numbers come through in your Analytics dashboard shortly.

    • Related Articles

    • Add A Pardot Form to WordPress

      There are many ways to include a Pardot form on your WordPress website. You can use a plugin, write custom code, or integrate it using a 3rd party tool. Here are five methods that I’ve used and tested, along with a detailed breakdown of how each ...
    • How to delete a WordPress site from CPanel

      FULL ARTICLE:  https://justlearnwp.com/delete-wordpress-site-from-cpanel/ Deleting a WordPress site completely is a simple and easy process, You just need access to your cPanel control panel. NOTE: If you have multiple sites on the same hosting ...
    • How do I add the Inverto360 button to my ORG?

      Inverto360 will install automatically from the App Exchange.  Once installed you must add the Inverto360 Button to the Account Page Layout.  This can be done manually (see attached PDF for instructions) or by using the update link below. Please note ...
    • Copy Related Lists and Chatter on Lead Conversion

      In Salesforce, lead management allows your marketing and sales teams to market, qualify, and build your sales pipeline with prospective customers. Once qualified then a lead can be converted into a formal Account, Contact and (optionally) an ...
    • How To: Assign a Record Type to a Profile

      You can associate several record types with a profile. For example, a user needs to create hardware and software sales opportunities. In this case, you can create and add both “Hardware” and “Software” record types to the user’s profile. From Setup, ...