I have Google Analytics code and Google Tage Manager code in the same page, when I use Google Tag Assisant extension to check my codes but it show that there is Google Analytics twice. This is how I put it in head of my html page:
Google Analytics:
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxx"></script>
<script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-xxxxxxx');</script>
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);
})(window,document,'script','dataLayer','GTM-xxxxxxx');</script>
This is what Google Tag Assistant:

How I can fix this ?
If you have the GA tag in GTM, you do not need to have the GA script in the head.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With