Thu, May 16, 2019
The original article was written on May 16, 2019, and it focused on sending data to Google Analytics Universal. However, during the migration of the blog to a new CMS, I decided to update the content to reflect the current version — Google Analytics 4.
The main reason why Google Tag Manager is installed on a website is to set up analytics systems without needing a developer's help. In this article, we’ll look at how to install three core analytics systems on your website: Google Analytics, Facebook Pixel, and Hotjar.
Before we begin, it’s important to note that all the above-mentioned analytics systems, as well as other services, are installed following the same basic scenario:
After making the necessary changes and verifying their correctness using debug mode, you’ll need to publish the changes as a new version. You can either publish each tag separately or group several tags into one version. To publish, click the Submit button at the top right:
Don’t forget to specify a version name that will help you remember which settings you published:
It’s fairly simple. Create a Google Tag type tag with the following settings:
You can find the Google Analytics 4 Measurement ID under Admin > Data Streams > Data collection and modification > Data Streams > Measurement ID:
And that’s it. Don’t forget to publish the container.
To make sure everything was set up correctly, open your website and go to the Realtime reports section in Google Analytics 4. You should see at least one active user there:
Of course, after installing the code, you’ll need to configure GA4 itself. You can learn how to do that by reading the article Step-by-Step Guide to Setting Up Google Analytics 4 (GA4).
Setting up Facebook Pixel is even easier. Just make sure to copy your Facebook Pixel code before you start.
Create a tag with the following settings:
That's it — only three steps, and don’t forget to publish the changes.
You can also use an alternative method by selecting a tag template from the community gallery, as I described here. The steps will be almost identical, except you’ll only need to insert the Pixel ID instead of the full code.
Setting up the Hotjar tag also takes just three steps:
Add the All Pages trigger.
Installing basic analytics codes is just the beginning. In upcoming articles, you’ll learn how to collect additional data by sending events:
If you enjoyed this content, subscribe to my LinkedIn page.
I also run a LinkedIn newsletter with fresh analytics updates every two weeks — here’s the link to join.
Web Analyst, Marketer