How to add Google Analytics script
-
I am trying to add my Google Analytics script to the HEAD section for non-neccessary cookies –
// Google Analytics
<!– Global site tag (gtag.js) – Google Analytics –>
async src=”https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXX”
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());gtag(‘config’, ‘G-XXXXXXXX’);
Is this the correct script to add? I have looked for various solutions, none of which have worked, and I can’t find anything on the support forum that shows specifically what (complete) code/script to add to the HEAD field to make this work. Please help!
- The topic ‘How to add Google Analytics script’ is closed to new replies.