Updated:2020-11
In 2020, Google released Google Analytics 4, which is actually the name change of APP + Web. It can track App and Web at the same time, aggregate data into the same property, and use all data in one report. This is a big change.
When APP + Web first released the Beta version, it could only be created through the Firebase console. Although it is still in beta, it can now be created in Google Analytics, which is more convenient.
Let’s take a look at the process of creation and deployment.
Create Property
Click Admin in the bottom left corner of Google Analytics:
Then the Admin management interface will be displayed, the interface is as follows:
Property setup
Click Create Property to create a Property,To start setting up, first Property setup.
The default is to create Google Analytics 4. If you want to create Universal Analytics, click Show More Options:
There are three positions that need to be set:
- Property name: Generally fill in the domain name of the website.
- Reporting time zone: Fill in your time zone.
- Currency: Select the currency type.
Then click Next.
Business information
- Industry category: Select the industry type of the website. The following two are optional settings, you don’t need to set them.
After setting, click Create to create Property.
Data Stream.Settings
- 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. There are the following types:
The default is to select all, you can remove it according to your needs.
After setting, click Create Stream 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.
Deployment Method
The next step is the deployment method. There are many deployment methods.
Page Hard-Coded Deployment
Page hard-coding deployment is to deploy APP+Web tracking code directly to the template page of the website.
Click on Global Site Tag (gtag.js) under Add new on-page tag, this is the tracking code:
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.
Deploy Through Google Tag Manager(Most Recommended)
I most recommend using this method of deployment.
My site has already deployed Google Tag Manager, let’s take a look at how to deploy GA4 tracking code through Google Tag Manager. This deployment method requires the use of MEASUREMENT ID, which is it:
Create a Tag in Google Tag Manager, name it GA4 Basic Tracking, select Tag Type Google Analytics: GA4 Configuration:
Paste the measurement ID into it.
There are some other settings below, we will ignore them for now, and how to set them later, and then select All Pages as the trigger.
This completes the configuration. The final configuration effect:
If the test is OK, it can be posted online.
Connected Site Tags
There is another form of forwarding:
- One is forwarded from Universal Analytics to GA4.
- One is to forward from one GA4 to another GA4.
Universal Analytics to GA4
This way is to forward the data in Universal Analytics to GA4. This deployment method requires the use of MEASUREMENT ID, which is it:
Then click Admin>Tracking Info>Tracking Code>Connected Site Tags in Universal Analytics:
Then paste the MEASUREMENT ID into it.
One GA4 to Another GA4
This deployment method is at the bottom of Additional Settings.
This method requires that the GA4 tracking code has been hard-coded on the website, and then its data needs to be sent to another Property. This method can be used.
Assuming that the website has been deployed with GA4 through hard coding of the page, the MEASUREMENT ID used is G-10000, and the data is sent to Property A.
- Property A: G-10000
- Property B:
Now create a new Property B, and send the data of the website to Property B, which can be forwarded through Connected Site Tags.
In fact, it is to forward the data of Property A to Property B.
Copy the MEASUREMENT ID of Property A directly, and click on the Connected Site Tags in Additional Settings in Property B:
Paste the MEASUREMENT ID to the position of Enter ID.
Click connect to complete the setting, the effect of setting:
Note: Only those deployed by hard-coding the page can use forwarding.
Send Data To Multiple Properties
The last method is to forward from Property A to Property B, but what do you do if you want to send it to Property A and Property B at the same time?
For example, our site has already deployed APP+Web, and now we need to add a cross-site tracking, then the data will be sent to two properties at the same time. For example, which Property to send an event to, this needs to be identified by a tracker.
In Universal Analytics, we will use Tracker Name. Its function is to ensure that the data sent to different properties is accurate.
There will also be this mechanism in APP+Web, called group. The default is default.
When we deployed, the code to send data to the measurement ID was:
<span style="font-size: 12pt;">gtag('config', 'G-HZ4RDGTX66'); </span>
The default is default, written as:
<span style="font-size: 12pt;">gtag('config', 'G-HZ4RDGTX66', { 'groups': 'default' }); </span>
The effect of these two writings is the same.
If you want to send data with two measurement IDs, the correct one should be:
<span style="font-size: 12pt;">gtag('config', 'GA_MEASUREMENT_ID-1', { 'groups': 'group1' }); gtag('config', 'GA_MEASUREMENT_ID-2', { 'groups': 'group2' }); </span>
If you want to send an event to GA_MEASUREMENT_ID-1, the event tracking can be written like this:
<span style="font-size: 12pt;">gtag('event', 'generate_lead', { 'send_to': 'group1' }); </span>
I think it can also be implemented on GTM, but I haven’t tested it successfully.
For more information, please refer to: https://developers.google.com/gtagjs/devguide/routing
Settings on Google Analytics
After deploying the code, we need to return to the Google Analytics Property to do some settings:
Mainly set up data storage and usage.
Data Collection
- Enable Google signals data collection:This is the previous Advertising Features upgrade. You can also use Google’s ID system to achieve cross-device tracking. It is recommended to open.
- Advanced Settings to Allow for Ads Personalization:The use of authorized data is all turned on by default, and you can turn it off.
Data Retention
The data retention time is two months by default, and 14 months is recommended.
Default Reporting Identity
User identification, the default is through UserID and Device, it will take effect only if you deploy User ID, otherwise it is based on device.
Of course, there are other settings, such as linking Google Ads and BigQuery.