Login to follow
Google Tag Manager Lib

Google Tag Manager Lib (ODC)

Stable version 0.1.0 (Compatible with ODC)
Uploaded on 10 October 2022 by Product League
Google Tag Manager Lib

Google Tag Manager Lib (ODC)

Documentation
0.1.0

To introduce Google Tag Manager (GTM) to your application, either use the web blocks, or call the client actions from Google Tag Manager Lib in the Header and Body of your page's layout, whichever is the most convenient for your project. 

Do not use both web blocks and client actions together, that would add the required js code twice!

Put your GTM-ID, taken from GTM Dashboard, as the input parameter.


For Head, it should be placed as high in the <head> of the page as possible (e.g. up in the Header placeholder of your page's layout).

For Body, immediately after the opening <body> tag (e.g. up in the MainContent placeholder of your page's layout). 


The web blocks/client actions of this library add a JS snippet to the HTML head and body that enables Google Tag Manager to fire tags by inserting gtm.js into the page (or through the use of an iframe when JavaScript isn't available).


Google Analytics Event Tag example

This is just a basic example of how Google Tags can be utilized to obtain usage statistics of your website.

Let's say this is a button on your wegpage and you want to track its clicks.

We give this button a new css class "gtm-button".


You can add a Google Analytics event in Google Tag Manager, for the click of this button. 


Then, statistics about the clicks of this button will be visible on Google Analytics dashboard. 


To get more info on how to set up Google Tags, please refer to the official documentation (https://support.google.com/tagmanager/answer/6103696?hl=en).