evalventure / mrlock-frontend

MrLock247
Apache License 2.0
0 stars 1 forks source link

Add Google Analytics script #26

Closed alexbrebu closed 2 years ago

alexandrumatei36 commented 2 years ago

Please create a Tag in Google Tag Manager and paste the script here. After this we can enable any Google service (Google Analytics, Google Search Console, etc) without adding additional scripts

alexbrebu commented 2 years ago

Either add to head:

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'[https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f)](https://www.googletagmanager.com/gtm.js?id=%27%20i%20dl%3Bf.parentNode.insertBefore(j%2Cf)&fbclid=IwAR0XelNlRQNjph8XThRRzscUKubq5qzbuug4f2VK94bL3hO8Fl4EwdFel24);
})(window,document,'script','dataLayer','GTM-K9ZHLKG');</script>
<!-- End Google Tag Manager -->

Either add to body:

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="[https://www.googletagmanager.com/ns.html?id=GTM-K9ZHLKG](https://www.googletagmanager.com/ns.html?id=GTM-K9ZHLKG&fbclid=IwAR2sQv2l6fxDnWZa9Mpz-ytHExvw09subavuLSUqQtD2cvYd1bsPg_uotVQ)"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

277683619_1032835650648303_5915246954024124616_n

alexandrumatei36 commented 2 years ago

nice. I'll let you know when this is done. In the meantime you can configure Google Analytics 4 (GA4) in the dashboard

alexbrebu commented 2 years ago
Captură de ecran din 2022-04-04 la 14 47 31

done. I guess it will work only after including the scripts