-
How to Simultaneously Utilize Google Analytics 4 and Universal Analytics
Hey there! Looking for a little help with some code – I’m trying to run Universal Analytics (UA) and Google Analytics 4 (GA4) simultaneously on the same webpage. Used the script below to set things rolling. Is this the right route? Or have I goofed up somewhere? Here’s the code in question, any insight would be much appreciated.
<script async src="https://www.googletagmanager.com/gtag/js?id=G-xxxxxxx"></script> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxx-x"></script> <script> window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'G-xxxxxxx', {'debug_mode': true}); gtag('config', 'UA-xxxxxxxx-x', {'debug_mode': true}); </script>
Log in to reply.