How to Install Google Analytics 4 in 2024 (3 Ways) (2024)

Updated: January 27th, 2024

If you want to measure the performance of your website, you must use some web analytics tool. Google Analytics 4 is one of them. It allows you to see the number of sessions, visitors, most popular traffic sources, etc.

But to get that, first, you need to install GA4 on a website.

In this blog post, I will show you three ways to do that. With the native GA4 tracking code (a.k.a. GTAG, a.k.a. Google Tag), with Google Tag Manager, and with a plugin (native integration).

Table of Contents

Here’s what you will learn in this article

  • #2. Install Google Analytics 4
    • #2.1. Install Google Analytics 4 with a plugin
    • #2.2. Install Google Analytics 4 with the native tracking code
    • #2.3. Install GA4 with Google Tag Manager
  • #3. Check the DebugView in Google Analytics 4
  • #4. Publish your changes in Google Tag Manager
  • #5. Google Analytics 4 real-time reports
  • #6. What’s next?
  • Final words

We have lots to cover, so let’s dive in.

A Video Tutorial on How to install Google Analytics 4

I have recorded a quick tutorial on my Youtube channel if you prefer video content. But if you want to learn additional details, read this blog post as well.

You’ll learn the most if you do both: watch the video and read the tutorial.

#1. Create a Google Analytics 4 Property & Data Stream

It all starts with a new property.

To create a new Google Analytics 4 property, go to the Admin section of your Google Analytics interface (by clicking theAdmin at the bottom-left corner) and then (in theProperty section) clickCreate Property.

Note: if you have never worked with GA before, then just go to analytics.google.com and then follow the steps to create your first property.

How to Install Google Analytics 4 in 2024 (3 Ways) (1)

Then enter the name of your property. It might be the name of your website, your company, a brand, etc. Choose your company’s country, reporting time zone, and the main currency your business operates.

How to Install Google Analytics 4 in 2024 (3 Ways) (2)

Then pressNext, and answer several questions. Then you will need to select your business objectives. Based on these choices, the reports that you will have in the interface will change too. To make things simpler right now, selectGet baseline reports.

How to Install Google Analytics 4 in 2024 (3 Ways) (3)

ClickCreate.

The next step to complete is to configure your first data stream. It is a data source from which events will be sent to your Google Analytics 4 property. You can have multiple data sources in a single property. For example, there are three web properties: 1 for the web, 1 for an Android app, and 1 for an iOS app.

In this blog post, I will focus on a Web stream. Select it.

How to Install Google Analytics 4 in 2024 (3 Ways) (4)

Then enter the URL of your website (for example, https://www.mywebsite.com). Note that the protocol (https) is already selected. After that, enter the name of your website.

When you create a web data stream in Google Analytics 4, you can enable/disable Enhanced Measurement. It is designed to help marketers get as many events in the reports as possible without the need to cooperate with developers or configure them in Google Tag Manager.

How to Install Google Analytics 4 in 2024 (3 Ways) (5)

By default, this feature is enabled and will automatically track the following events:

  • Page view (event name: page_view)
  • Scroll (event name: scroll)
  • Outbound link click (event name: click with the parameteroutbound: true)
  • Site search (event name: view_search_results)
  • Video Engagement (events:video_start, video_progress, video_complete)
  • File Download (event name:file_download)
  • Form events (form_start, form_submit)

If you want, you can disable/enable events individually. You can do that by clicking the gear icon in theEnhanced Measurementsection and then clicking the toggle buttons.

How to Install Google Analytics 4 in 2024 (3 Ways) (6)

When you’re ready, press the Create stream button.

#2. Install Google Analytics 4

There are three ways to install Google Analytics 4 (which depend on your website and context):

  1. Install GA4 with a Google Analytics plugin/integration
  2. Install with GTAG (a.k.a. Google Tag, a.k.a. native GA4 tracking code)
  3. Install GA4 with Google Tag Manager

You will need to choose one option.

#2.1. Install Google Analytics 4 with a plugin

This is a good option for popular content management systems with built-in GA4 support or support GA4 plugins. Examples of popular platforms are WordPress, Squarespace, Shopify, Magento, etc.

There are many different platforms/systems, and they work differently, so you will need to do your research to find out if they support Google Analytics 4 natively. If not, maybe your system supports 3rd party plugins that can be installed?

This could be done quickly by googling “[your platform name] google analytics 4”, for example, “WordPress google analytics 4”.

How to Install Google Analytics 4 in 2024 (3 Ways) (7)

Once you find the instructions, follow them, and you should be good.

For example, on WordPress, there are various plugins that offer GA4 integration, like GA4WP. After you install the plugin, it will ask you to enter the Measurement ID.

How to Install Google Analytics 4 in 2024 (3 Ways) (8)

You can find the ID by going to Google Analytics > Admin > Data Streams > Select your web data stream. Finally, at the top right corner, you will see the ID that starts with G-.

How to Install Google Analytics 4 in 2024 (3 Ways) (9)

This is the measurement ID. Copy it, paste it into the plugin’s settings, and save the changes. Done! The next step is to test, and you will learn how to do that here.

#2.2. Install Google Analytics 4 with the native tracking code

If you are working with a website, that does not have a native GA4 integration or doesn’t support GA4 plugins, then you can ask the developer to install the native GA4 tracking code directly in the source code of the website.

In GA4 Admin > Data Streams, select your Web Data Stream. Then click View tag instructions.

How to Install Google Analytics 4 in 2024 (3 Ways) (10)

Then select Install manually and copy the code that you’ll get:

How to Install Google Analytics 4 in 2024 (3 Ways) (11)

You should give that code to a developer and ask him/her to install this code in the <head> section of *all* pages of your website. The developer will know what this means.

Done! The next step is to test, and you will learn how to do that here.

#2.3. Install GA4 with Google Tag Manager

If you want to have more flexibility and power in managing tracking codes, then the third installation option (Google Tag Manager) is what you need. First, you must install GTM on your site (learn how to do that here).

After that, go to GA4 > Admin > Data Streams, select your web data stream, and copy the measurement ID.

How to Install Google Analytics 4 in 2024 (3 Ways) (12)

Then go to your Google Tag Manager container (if you haven’t worked with it, here’s atutorial on how to get started)> Tags > Newand chooseGoogle Tag.

In theTag IDfield, enter the ID that you copied in the GA4 interface.

How to Install Google Analytics 4 in 2024 (3 Ways) (13)

In the Triggering section, select Initialization – All Pagesand then name the tag, e.g.,Google Tag.

Then it’s time to test it. Click Preview in the top right corner of the GTM interface.

How to Install Google Analytics 4 in 2024 (3 Ways) (14)

Once you enable the preview mode, you should see the new Google tag among the tags that fired.

How to Install Google Analytics 4 in 2024 (3 Ways) (15)

The next step will be to check if data is displayed in Google Analytics 4. I will explain thisin the next chapter of the blog post. After that, you will need to publish the changes.

#3. Check the DebugView in Google Analytics 4

Once you install Google Analytics 4, it’s time to test. The primary feature built for debugging GA 4 data is the DebugView section.

Head over to yourGoogle Analytics 4 account > Admin > Debugview.

How to Install Google Analytics 4 in 2024 (3 Ways) (16)

Most likely, you will not see any data there (yet). That’s because that data in the DebugView is visible ONLY when the debug mode in GA4 is enabled. Do not mix this with the GTM Preview and Debug mode. They are two different beasts.

If you installed GA4 by choosing method 1 (plugin) or method 2 (GTAG), install theGoogle Analytics Debugger extension in your Chrome browser. In the list of installed extensions, click the GA debugger’s icon.

How to Install Google Analytics 4 in 2024 (3 Ways) (17)

After that, go to your website (where GA4 is installed), browse the site, and visit several pages.

If you installed GA4 with Google Tag Manager, having the GTM Preview mode enabled automatically makes the data visible in the GA4 debug view.

Then, you should start seeing data in the DebugView. Click on every individual event to see the list of parameters.

Click on that parameter to see the value that was received by GA4. Now, that is some granular debugging!

How to Install Google Analytics 4 in 2024 (3 Ways) (18)

If debugview is not working for you, read this troubleshooting guide.Sometimes, refreshingDebugView’s page helps too.

Also, ensure you have selected the correct Debug device in the top left corner.

How to Install Google Analytics 4 in 2024 (3 Ways) (19)

If multiple visitors have enabled the debug view (e.g., they all have enabled the Chrome extension), you will see multiple devices there and it might require some time to find yourself. This especially applies to my blog, when many of my readers have enabled the GA Debugger Extension, and I have to guess which device (out of the other 15) is mine 🙂

Anyway, once you start seeing data in DebugView, things will look like this.

How to Install Google Analytics 4 in 2024 (3 Ways) (20)

If you see your events in the debugview, GA4 was installed properly.

#4. Publish your changes in Google Tag Manager

This step is required only if you are using GTM to install GA4. Once you have made sure that the data is coming in and it is displayed properly, you should submit your GA4 changes in the GTM container and publish it.

You can do that by clicking the SUBMIT button in the top right corner and then completing all the other steps that the user interface asks you to do.

How to Install Google Analytics 4 in 2024 (3 Ways) (21)

After that, you should soon start seeing the new data coming in your real-time reports as well.

#5. Google Analytics 4 real-time reports

On the left sidebar of the Google Analytics 4 interface, go to Realtime. This is where you will see the data coming into your reports. Unlike in the previous version (Universal Analytics), the new report offers you capabilities to see the data on a much more granular level.

First, you will see a map and a bunch of cards with traffic sources, the most popular events, and the number of users in the last 30 minutes.

You can also take a look at the snapshot of an individual user. You can do that by clicking theView user snapshot button in the top right corner.

How to Install Google Analytics 4 in 2024 (3 Ways) (22)

Then, you will see a stream of all events of that particular user, you can click on them (just like in the DebugView) to see things on a more granular level. If you wish to look at another user/visitor, you can click the button here:

How to Install Google Analytics 4 in 2024 (3 Ways) (23)

To exit the snapshot, press theExit snapshotbutton in the top right corner.

#6. What’s next?

I will not go into too much detail here, but here are several things for you to configure next:

You will also find additional migration tips in this free e-book. Also, you can watch this video.

Final words on how to install Google Analytics 4

And that’s how you install Google Analytics 4 on your website.

Speaking of the process, here’s a summary:

  • Create a new GA4 property
  • Create a data stream (in this blog post, I focused on the Web stream)
  • Install GA4. You can do that with a plugin, native tracking code, or Google Tag Manager.
  • Check the debugview and realtime reports and see if your data is coming in

Got more questions? Feel free to ask in the comments below.

How to Install Google Analytics 4 in 2024 (3 Ways) (2024)
Top Articles
Latest Posts
Article information

Author: Nathanial Hackett

Last Updated:

Views: 6446

Rating: 4.1 / 5 (72 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Nathanial Hackett

Birthday: 1997-10-09

Address: Apt. 935 264 Abshire Canyon, South Nerissachester, NM 01800

Phone: +9752624861224

Job: Forward Technology Assistant

Hobby: Listening to music, Shopping, Vacation, Baton twirling, Flower arranging, Blacksmithing, Do it yourself

Introduction: My name is Nathanial Hackett, I am a lovely, curious, smiling, lively, thoughtful, courageous, lively person who loves writing and wants to share my knowledge and understanding with you.