Tag Manager - How and Why?
For optimal marketing measures, it is important to know your target audience. This usually involves the use of analytics tools. To manage these tools comfortably, tag managers are often used. How can a simple configuration look like?
![Tag Manager - How and Why? Tag Manager - How and Why?](https://www.codeaware.at/assets/images/posts/code_hu3d03a01dcc18bc5be0e67db3d8d209a6_4001289_900x600_fill_q95_h2_lanczos_center.webp)
![Ing. Philipp Doblhofer Ing. Philipp Doblhofer](https://www.codeaware.at/assets/images/global/doblhofer_hufaff7b805266c713f172f1de593264c0_4648679_160x0_resize_q90_h2_lanczos.webp)
Ing. Philipp Doblhofer
Tag managers are used on many websites – especially when the affected website is to be optimized for users or a marketing campaign is being monitored. These managers allow, among other things, the comfortable configuration and management of analytics scripts without having to adjust the website’s code itself. By integrating a tag manager, a marketing department can (in many cases) configure and manage analytics scripts independently of the website programming.
A widely used tag manager is the Google Tag Manager. Typical use cases are illustrated here with short examples.
Setting up Google Tag Manager
The Tag Manager can be set up at https://tagmanager.google.com/. An account can be created by selecting ‘Create account’. Multiple independent containers can be managed within an account:
After an account has been created, a container for an account can be created via the icon with the 3 dots:
Then, 2 code snippets are displayed. These must be inserted into the website’s code. From then on, tags can be freely integrated on the site.
Integrating Google Analytics
In the Variables section, a new custom variable must be created for this purpose. This should be a “Google Analytics Settings” type. The tracking ID generated by Google Analytics must be specified here. For GDPR compliance, the “anonymizeIP” option should also be activated:
Then, in the “Tags” section, we create a tag for the PageView event, which is triggered for every page visit:
“Page View” is set as the tracking type, and we specify our newly created variable as the Google Analytics setting. “All Pages” is set as the trigger.
For correct GDPR-compliant integration, depending on the use case, it may be necessary for these tracking scripts to become active only after an opt-in. Accordingly, the trigger section must be adjusted in this case.
The settings made can be tested with the “Preview” button and then published with the “Submit” button.
Analyzing Link Clicks
For this, a trigger for link clicks is created. This is triggered whenever a link is clicked:
Only the corresponding tag for the complete implementation is missing. In Google Analytics, we represent these actions as an event:
However, the possible applications are not limited to the examples shown above. For example, scroll depth and other metrics can be recorded. Complex events for conversion paths can also be configured. These are much easier to manage than if they were directly embedded in the code.
But it’s not just Google Analytics that is supported by tag managers. Google Ads, Facebook, or LinkedIn pixels can also be used. There is a variety of marketing tags offered – but if the right one is not among them, simple HTML code for the tracking code can also be integrated. Recently, templates have also been available: these are preconfigured tag settings by other users that allow the comfortable use of further tags – which have not yet been implemented by Google.