After entering all the required information, the "Create" button will be activated. Click it to get a Google Tag Manager account and your first container.
You will see two pop-ups – terms of use and code snippets that you need to add to your site to complete the GTM installation. The Google Tag Manager code is divided into two parts.
GTM code
The first part of the code is inserted into the egypt telegram data tag < head >. The second part is inserted after the tag < body >.
Note: “The second part of the code is a backup. It is only needed if JavaScript scripts are blocked on the site. Then, if the first part is blocked, the second will work and launch GTM. However, in 99% of cases this is not relevant now, because almost no one blocks scripts anymore ,” explains Webpromo web analyst Mykhailo Kulyk .
Is it possible to put the first part of the code not in < head >?
Yes, you can add the GTM code, for example, in < body >, but it is recommended to place it in < head >or as close to it as possible. After all, the higher up the page the snippet is, the faster it loads. This allows you to capture more visitors and see how they behave, including determining the percentage of traffic that returns before the page is fully loaded.
How to set up Google Analytics using Google Tag Manager
One of the first things you'll want to set up with Google Tag Manager is Google Analytics.
How to do it?
Create a variable of type "Google Analytics Settings".
Create a tag with the following settings:
Tag type – Google tag.
GA4 settings
Tracking type – Page view.
Google Analytics settings - in this section, select the variable we created in the previous step, or enter the resource identifier in the format G-XXXXXXXXXX.
Configuring GA4
In the Triggers section , select All Pages and click the "save" button to have the new tag appear in your workspace.
Setting the trigger
After that, you need to add the tag to your site. To do this, use the "submit" button in your workspace.
Publish changes
A window will appear in front of you where you should add a version name and click "publish".
GTM tag publication
You can come up with a name and write a comment. This is helpful when multiple users are working with GTM
Sign up for a Google Analytics account .
-
- Posts: 781
- Joined: Thu Jan 02, 2025 7:11 am