Update time: June 11, 2025
This article will introduce how to install Google Analytics 4 using gtag
Create GA4 Property
In GA4, click 「Admin」——「+Create」——「Property」:
Create Property
- Property name: Generally fill in the domain name of the website.
- Reporting time zone: Fill in your time zone.
- Currency: Select the currency type.
After configuration, click 「Next」.
Business Details
- Industry category(Required): Select the industry type of the website.
- Business size (Required): Select number of employees
After configuration, click 「Next」.
Business objectives
This setting will mainly generate some built-in reports for different industries. Choose according to your needs:
After configuration, click 「Create」.
Data collection
- Website URL: Set the homepage address of the website.
- Stream name: Set the name of the website.
- Enhanced measurement: Some of the built-in tracking can be achieved only by checking, which is very convenient.default is to select all, you can remove it according to your needs.
After setting, click「 Create & Continue」to create Data Stream.
Data Stream is set up, this is the detailed information of the data stream.
- STREAM URL: The default address of the website.
- STREAM NAME: Site name.
- MEASUREMENT ID: similar to Tracking ID.
- STREAM ID: similar to Tracking ID.
MEASUREMENT ID and STREAM ID are similar to Tracking ID, but MEASUREMENT ID can only be used in the Web, and STREAM ID can only be used in APP.
Install gtag to Website
This method is to deploy the gtag tracking code directly to the template page of the website without using GTM.
Copy this code, log in to the server, find the head position of the template page, and paste it.
If you don’t have server permissions, please send this code to the developer’s notice and let them help deploy.
Test and Verify
In the browser developer tools, under Network, filter by “v=2“, you can see the data is sent to GA4 server.
Read More :