Learn business growth with Google Analytics 4 Forums Google Analytics 4 How to Simultaneously Utilize Google Analytics 4 and Universal Analytics Reply To: How to Simultaneously Utilize Google Analytics 4 and Universal Analytics

  • John

    Member
    8 July 2023 at 4:38 am

    The idea of running Universal Analytics (UA) and Google Analytics 4 (GA4) simultaneously on the same webpage is a common approach when transitioning from UA to GA4, as it allows you to have both versions running at the same time. The script you presented does reflect this approach. However, you don’t need to include the ‘gtag.js’ script twice for both UA and GA4. You only need to include it once, then specify both tracking IDs (GA4 and UA) in the ‘config’ calls within the script. ‘Debug_mode’ is also an optional parameter. If it’s set as true, it will produce verbose debug information to the console; remove it or set as false in a live environment.