Thursday, July 20, 2023

How to Add Google Analytics 4 to WordPress

How to Add Google Analytics 4 to WordPress

Need to update to Google Analytics 4, but not sure how? Having a hard time setting up the now-required Google Analytics 4? In this post, I'll show you how.

analyzing website dataanalyzing website dataanalyzing website data
Google Analytics 4 is now the only type of Google Analytics you can run on your site, but it's easy to set up.

Google Analytics 4 is replacing its predecessor Universal Analytics, which is due to stop collecting data in July 2023 (July 2024 for Google Analytics 360 customers). The switch to GA4 is mandatory for non-360 customers, so it’s important to get started now.

Don’t worry! This practical guide will walk you step by step through how to easily install and activate GA4 on your WordPress website. Let’s get started updating your old Google Analytics.

Install and Activate the Google Analytics for WordPress Plugin

The first step to setting up Google Analytics 4 on your website is to install a WordPress plugin that can add the Google Analytics tracking code to your website. 

To do this, navigate to the plugins section in your WordPress dashboard, click on Add New, and search for Google Analytics.

installing google analytics plugininstalling google analytics plugininstalling google analytics plugin

From the search results, find GA Google Analytics or MonsterInsights, widely recommended plugins known for their seamless WordPress integration with Google Analytics 4.

Select Install Now and then click Activate.

You have now successfully installed and activated your Google Analytics plugin and are ready to set it up.

Create a Google Analytics 4 Property

As you transition from Universal Analytics to GA, it's essential that you create a new Google Analytics 4 property for your WordPress site. Here are the step-by-step instructions.

Visit the Google Analytics website and click on Admin in the lower left corner of your account.

clicking admin google analyticsclicking admin google analyticsclicking admin google analytics

In the Admin panel, select your account in the Account column. Then go to the Property column and click on + Create Property.

creating propertycreating propertycreating property

Name your new property based on your WordPress site, and then fill out the Business Details and Business Objectives pages.

filling out property information google analyticsfilling out property information google analyticsfilling out property information google analytics

On the final setup screen, click Web as your platform. Enter the details of your WordPress site, including its URL under Website URL and the name of the website.

Click on Create, accepting the terms of service agreement if necessary.

Your Google Analytics 4 Property is now set up and ready to collect data. 

Obtain the Google Analytics 4 Measurement ID

Now that you have your Google Analytics Property set up, you must obtain your Measurement ID. 

Click on the Admin button located in the lower-left corner of your screen in Google Analytics.

Under the Property column, select Data Streams.

data streamsdata streamsdata streams

Choose the Web option and select the property that you just set up. A panel will appear that has all of the stream's information, including the Measurement ID.

measurement idmeasurement idmeasurement id

Copy the Measurement ID as you need it to configure your Google Analytics WordPress plugin. 

Configure the Google Analytics for WordPress Plugin

To configure the Google Analytics for WordPress Plugin, follow these steps:

Go to the Settings menu in your WordPress dashboard and click on Google Analytics.

settings google analyticssettings google analyticssettings google analytics

Enter your GA4 Measurement ID in the GA Tracking ID section.

GA Tracking ID sectionGA Tracking ID sectionGA Tracking ID section

Next choose the tracking method, Google Tag, in the section below.

Finally, click the Disable tracking of Admin-Level users section so your admin activity doesn’t get tracked by Google Analytics.

Disable tracking of Admin-Level usersDisable tracking of Admin-Level usersDisable tracking of Admin-Level users

Save the changes and exit the settings.

Now it's time to verify that Google Analytics 4 is working on your WordPress site. 

Verify Google Analytics 4 Tracking on WordPress

To ensure that Google Analytics 4 (GA4) is properly set up and tracking on your WordPress site, you can verify it in a few ways:

Verify the Installation Using Real-Time Reports

Open your website in a new browser tab.

Go back to your Google Analytics account and navigate to the real-time reports.

Look for the Overview report and check if your website appears in the Active users right now section. If you see active users on your website, it means that GA4 is tracking your website. 

 Active users right now Active users right now Active users right now

Use the DebugView Feature

Open your website in a new browser tab.

Add the following to the end of your website’s URL, ?debug_mode=true.

append urlappend urlappend url

Next, open your browser's developer console by right-clicking and selecting Inspect or by pressing F12.

Look for the Google Analytics DebugView panel in the console, and check for any error messages or warnings related to GA4. If there are no errors or warnings, it suggests that GA4 is functioning properly.

look in inspect consolelook in inspect consolelook in inspect console

Download High-Quality WordPress Plugins

Looking to take your WordPress site to the next level? WordPress plugins are an invaluable tool for all WordPress site owners. They give your site important features for running a successful site that new WordPress websites don’t have.

Check out the following resources for tons of great plugins that you can download for your WordPress website today!

Unlock the Power of Google Analytics 4 for Your WordPress Site

Adding Google Analytics 4 to your WordPress site is a straightforward process that can provide valuable insights into your website's performance. By following the steps outlined in this guide and using the available plugins, you can easily configure GA4 tracking and take advantage of its powerful features.

With GA4, you'll have access to enriched customer data and enhanced marketing capabilities, allowing you to optimize your ads and boost your overall online presence. So don't miss out on this opportunity to unlock the full potential of your WordPress site with Google Analytics 4!

If you need more high-quality plugins and themes for your WordPress site, use Envato Elements. You can access thousands of WordPress resources at a low monthly cost.


No comments:

Post a Comment