You don’t need to setup Google Analytics account because of Google Analytics demo account. The following are steps in setting up the real Google Analytics for reference.
Get started with Google Analytics
Create a new account and property
To create a new account, go to the Analytics page and select Get started today. You must enter or select the following required information: account name, property name, time zone, currency, and (optional) business information.
Create a data stream
After you accept the terms of the service agreement, you can choose the type of data stream to monitor for a website or mobile app:
- Web: If you select Web, enter the homepage URL and a unique stream name.
- Android app: If you choose an Android app, enter the package name and app name.
- iOS app: If you select an iOS app, enter the bundle ID and app name
A measurement ID is then assigned to the data stream.
Enable tagging
For tagging instructions, choose whether to add a new on-page tag or to use an existing on-page tag. Select to use an existing on-page tag only if you are adding a Google Analytics 4 (GA4) property to a website that already has a tag for Universal Analytics (UA). The existing tag becomes a connected site tag to send data to the Google Analytics 4 property.
If you are adding a new tag, you can select to use the global site tag or Google Tag Manager.
Enable data collection
Finally, to enable data collection, implement the global site tag or deploy the tag with Tag Manager.
If implementing the global site tag manually, you must copy and paste the displayed site tag in the HTML <head> section of each page you want to monitor.
A site tag looks similar to the following:
<!– Global site tag (gtag.js) – Google Analytics –> https://www.googletagmanager.com/gtag/js?id=G-3T28EEHGZS <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag(‘js’, new Date());
gtag(‘config’, ‘G-3T28EEHGZS’); </script>
More information on setting up Google Analytics instructions:
Global site tagging and Google Tag Manager
Analytics tools like Google Analytics can only monitor websites that have been tagged for monitoring. In other words, a tag, or piece of code, must be run on each website to make these tools aware of them. There are two methods of tagging: using a global site tag or using Google Tag Manager.
Google site tagging
Google site tagging, gtag.js, is a single tag that can be implemented on a website. It is added to the HTML <head> element of each website’s page. The <head> element contains the metadata for a page – information that isn’t displayed but is important for website management. This global tag supports multiple Google products in addition to Google Analytics. After adding this tag, other products like Google Ads can also be turned on for the site metrics for the traffic coming from Google Ads can be collected.
The main advantage of using global site tagging is that it is designed for use with all Google products and services. Additional tags are required to monitor traffic from other advertising or media platforms or to enable monitoring with other analytics tools. Use Google Tag Manager to work with additional tags for non-Google platforms.
Google Tag Manager
For more universal tagging, Google’s solution is Google Tag Manager, a tag management system (TMS) that enables the deployment and management of many tags for multiple advertising platforms and systems in a simple and centralized way. After a small snippet of Tag Manager code has been added to a website analytics and measurement tags can be deployed to many platforms from Tag Manager’s web-based interface.
Google Analytics 4 tags in Google Tag Manager
Google Tag Manager supports Google Analytics 4 properties with two tags:
- Google Analytics: GA4 Configuration
- Google Analytics: GA4 Event
The Google Analytics Configuration tag initializes Google Analytics data collection for a Google Analytics 4 property and has to be added to all pages. This enables basic Google Analytics 4 measurements, which include automated events and enhanced measurement events if the enhanced measurement feature is enabled during the setup phase.
The Google Analytics 4 Event tag, which can be added to particular interactions or web pages enables custom events to be sent to Google Analytics 4 property. Custom events enable the monitoring of metrics beyond those automatically sent for every event or those enabled by turning on enhanced measurement.
The primary differences between using Google’s global site tag and Google Tag Manager are:
- The global site tag works with Google tools only and Google Tag Manger works with any HTML or JavaScript tags.
- All tags are implemented using JavaScript code, but Google Tag Manager offers the additional feature of a graphical interface to deploy tags.
More information about using the global site tag or Google Tag Manager: