Install Google Analytics 4 with GTM(2026)

Google Analytics BCS 7 years ago (2019-11-03) 3960 Views 0 Comments
文章目录[隐藏]

Update time: March 13, 2026

In this article I will show you how to deploy Google Analytics 4 through Google Tag Manager.

Install Google Tag Manager

Creates GTM Container

First, create a container in GTM, click「⋮」——「Create Container」:

Install Google Analytics 4 with GTM(2026)

Then see the setting interface of the Create Container:

Install Google Analytics 4 with GTM(2026)

  • Container Name:Custom container name, usually fill in the domain name, here it is named http://www.bcs.com
  • Target Platform:According to the actual situation, choose Web here.

Finally click 「Create」 to create a new container.

Install Google Analytics 4 with GTM(2026)

Deploy the GTM Library Code to the Website

Click to open the container you just created, click「Admin」——「Install Google Tag Manager」:

Install Google Analytics 4 with GTM(2026)

The code has two paragraphs, need to be installed on all pages of the website, usually installed on the template page, one that needs to be deployed to the header, and one that needs to be deployed to the body.

Install Google Analytics 4 with GTM(2026)

 

If you don’t have server permissions, you need to let the development colleagues handle it.

 

Test

Finally, it is time to test. Before testing, you need to publish a version in GTM to ensure that GTM can load normally. Note that if there is no published version, GTM will prompt a 404 error when loading.

In GTM, click 「Submit」——「Publish」 the upper right corner to publish.

Open the website in the browser, then open the browser developer tools, click Network, and then filter with “GTM”. You can see that GTM’s JS can be loaded normally, and the status is 200, indicating that the deployment is fine.

Install Google Analytics 4 with GTM(2026)

Read More:Install Google Tag Manager on Your Website

 

Create GA4 Property

In GA4, click 「Admin」——「+Create」——「Property」:

Install Google Analytics 4 with GTM(2026)

Create Property

Configure the following settings:

Install Google Analytics 4 with GTM(2026)

  • Property name: Typically use your website’s domain name.
  • Reporting time zone: Select your local time zone.
  • Currency: Choose the currency used for reporting.

After completing the configuration, click 「Next」.

Business Details

Fill in the required business information:

  • Industry category (Required): Select the industry that best describes your website or business.
  • Business size (Required): Choose the number of employees in your organization.

 

Install Google Analytics 4 with GTM(2026)

After completing the configuration, click 「Next」.

Business objectives

These settings help GA4 generate recommended reports and insights based on your business goals:

Install Google Analytics 4 with GTM(2026)

Select the options that best match your needs, then click 「Create」.

 

Data collection

In this step, you will create a Data Stream:
Install Google Analytics 4 with GTM(2026)
GA4 supports three types of data streams: IOS, Android and Web, Multiple streams can send data to the same GA4 Property.

Configure the Web Data Stream

For a website implementation, choose Web to create a web data stream.
Install Google Analytics 4 with GTM(2026)
  • Website URL: Enter the homepage URL of your website.
  • Stream name: Provide a name for the website or data stream.
  • Enhanced measurement: This feature automatically tracks several common interactions (such as page views, scrolls, and outbound clicks). By default, all options are enabled. You can disable any that you do not need.

After completing the setup, click「 Create & Continue」to create Data Stream.

Data Stream Details

Once the Data Stream is created, you will see its details:

Install Google Analytics 4 with GTM(2026)

  • STREAM URL: The default website URL.
  • STREAM NAME: The name of the site or stream.
  • MEASUREMENT ID: Similar to the Tracking ID used in Universal Analytics.
  • STREAM ID: The internal ID of the data stream.

Both Measurement ID and Stream ID function like tracking identifiers. However:

  • Measurement ID is used for Web tracking.
  • Stream ID is primarily used for App tracking.

GA4 is now set up. Copy the MEASUREMENT ID, which will be used in the next step.

 

Configure GA4 on GTM

Configure GA4(Google Tag)

From the previous step, we know that the measurement ID is G-4X87W9BLM3. Create a Constant variable to store it for later reuse.

In GTM, click「Variable」——「New」——「Choose a variable type to begin setup…」——「Constant」, name it “Measurement ID”, and then make the following settings:Install Google Analytics 4 with GTM(2026)

 

In GTM, click「Tags」——「New」——「Choose a tag type to begin setup…」——「Google Analytics」——「Google Tag」, name it “GA4 Tracking Code”, and then make the following settings:

Install Google Analytics 4 with GTM(2026)

 

Preview and Test

Next is the preview test. Click 「Preview」 in the upper right corner.

Install Google Analytics 4 with GTM(2026)

It will open the Tag Assistant:

Install Google Analytics 4 with GTM(2026)

 

  • Your website’s URL: Enter the domain name to be tested. Here, it is https://www.bbccss.com
  • Include debug signal in the URL: Uncheck

Finally, click “Connect” and it will open the website. You will see Tag Assistant Connected in the lower right corner of the website, indicating that it has successfully entered the test state:

Install Google Analytics 4 with GTM(2026)

 

Return to Tag Assistant and find Window Loaded in Summary. You can see that the configured GA4 Tracking Code is triggered:

Install Google Analytics 4 with GTM(2026)

This means that the configuration is fine.

You can also verify it in GA4’s Debugview and real-time reports, where you can see the data.

Publish

If there are no problems with the test, you can publish it.

In GTM, click 「Submit」——「Publish」 the upper right corner to publish.

Like (0)
Post my comment
Cancel comment
Expression Bold Strikethrough Center Italic

Hi, you need to fill in your nickname and email!

  • Nickname (required)
  • Email (required)
  • Website