Introduction
Google Analytics is a free web analytics service offered by Google. Google Analytics helps you to track website traffic, video, social network traffic, as well as your return of income (ROI) and, provides statistical information about the demography that is from which parts of the world the traffic is coming from, age and even gender information. Needless to say, how supportive this information is when you have to get insightful decisions about your business or any other project you do. The great thing is that you can get the most out of this service for free.
In October 2020 Google Analytics 4 was released with new features such as
- AI-powered Predictions and insights
- Reporting on your customer life cycle
- New methods for data control
If you are interested in this link, you can read further about those features.
Procedure
Before installing Google Analytics on your web page, obvious to create a Google Analytics account and also set up Google Tag Manager, which is a really easy and straightforward procedure. Just use these links to go to the Google Analytics Home Page and Google Tag Manager Home Page and create and set up those accounts for free.
However, some issues can occur later if you use Google Analytics 4 also called GA4 since it was released recently and some website builders may not have updated their services to be compatible with the newest features of GA 4.
You can clarify your doubts and read further about creating a Google Analytics account and setting up Google Tag Manager from this link.
Install Google Analytics to the website using “Measurement ID”
- Go to your GA4 account Admin tab and create a new GA4 property by clicking the “+ Create Property” icon. As you can see in the below picture, the Property that I have already created is called “Travel and Recipes”. You can have many properties inside a GA4 Account, and you also can have many GA4 accounts inside your Google Account.
- Then select to what category your website belongs to and the number of employees if the website belongs to a company. You will also have to select time zone and currency from the next dialogue box that appears, but you can change this later as well. Select the “web” icon in the next window, since the data stream that you are going to set up for your GA4 account is from a website. This means you can use GA4 for your Android app and iOS apps too.
- Then to set up your webstream, paste the URL of your website in the “Website URL” box give it a Stream name in the “Stream Name“ box and also keep the Enhanced measurement icon toggled on.
- After you successfully do that, you will get the “Measurement ID” and the “Stream ID” in the “Web stream details” window for this particular stream. This information is possible to retrieve whenever you need it, by accessing your GA4 account.
If your website is built on “WordPress” a simpler way to connect it to GA4 is to copy the “Measurement ID” from “Web Stream Details” in your respective property of the GA4 account. And then go to settings in your “WordPress” website dashboard. Go to“Tools”, “Marketing” and then “Traffic”. Then scroll down until you find the place shown in the picture below and paste it there. Then click “Save settings”.
If your website is built on some other website builder other than “WordPress”. In that case simply go to the website administration page and try to find the option called “Integration” which will allow you to paste the “Measurement ID”.
Set up Google Analytics with Google Tag Manager
- Go to your Google Tag Manager Dashboard and click on “Add a new Tag” icon.
- Then in the next window, choose “Tag configuration” and then Google Analytics GA4 Configuration.
- In the next window, you can paste your respective “Measurement ID” from the GA4 property and save it.
- Then click on the “Triggering” section and choose “All Pages” or any other option as per your requirement to trigger the tag to send data to your GA4 Analysis from your website.
You can also use Google Tag Manager (GTM) to add and maintain Tags via the web interface. And the cool thing is GTM allows you to use non-Google tools and Third-party tags too. So that you can implement those products on your website and receive analytical data to your GA4 account. Go to this link to read furthermore about GTM solutions and this link to read further about GTM supported tags.
Install Google Analytics to the website with the Global Site Tag.
- In the Web Streaming detail page of your GA4 property in the middle part, you will see the “Global site tag” under “Tagging Instructions”. If you have access to the HTML code of your website, paste the “Global site tag” into the <head> section of the HTML code.
Note about privacy
While doing an implementation of Google Analytics, always keep in mind GDPR. Always set up all your tags with IP anonymization. Make sure you are not collecting any e-mail addresses or other personalized data. And always fire your cookies after user consent in the cookie banner. In the best case, talk to you your data security person, to be on the secure side.
Conclusion
There are many was to implement Google Analytics to your website other than the 3 ways mentioned above. As an example, by using a third-party plugin such as “Monsterinsights”, “ExactMetrics”, “Analytify” etc… Anyway, basically, it is required to obtain the Measurement ID by creating the respective property in your GA4 account. So that you can use it in any method convenient to you to implement Google Analytics for your website. The possibility to deploy third-party analytical tools and tags on your website using the Google Tag Manager platform is also a great advantage.
Useful Links
You can read further about manipulating GA4 tags, setting up Google Analytics Goals, how to grant access to your GA4 analytics to others, etc… from this link.
Check this link to read about how to use Debug view the Google Analytics 4, How to publish your Google Tags and GA4 real-time reports.
If you have already deployed the older version of Google Analytics, read this article to learn how to convert it to GA4.
This article was developed during collaboration with Manoj Rasika Koongahawatte, during Predictea Analytics Programme.