How to use gtag.js to install Google Tag Manager

The Global Site Tag or gtag.js was recently introduced as the recommended script format for installing Google Analytics (GA) on blogs or websites. But I have found that you can also use it to install Google Tag Manager (GTM).

In the sample code below, just replace GTM-XXXX with your own container ID, as follows:

After doing some tests, I have found that the above code actually works identically with the official GTM script below.

Labels: ,

« Older PostBack to TopNewer Post »