Home »
» How to use gtag.js to install Google Tag Manager
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:
window.dataLayer=window.dataLayer||[];
function gtag(){dataLayer.push(