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 taiwan consumer email list Manager is Google Analytics.
How to do it?
Sign up for a Google Analytics account .
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
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
Done! Google Analytics is now collecting data from your site
-
- Posts: 485
- Joined: Sun Dec 22, 2024 8:31 am