Learn business growth with Google Analytics 4 Forums Google Analytics 4 Do I need to modify website code for GA4 property linked to UA to switch from UA- to G-ZZZ? Reply To: Do I need to modify website code for GA4 property linked to UA to switch from UA- to G-ZZZ?

  • Sophie

    Member
    23 June 2023 at 11:37 pm

    It’s crucial to understand that setting up a GA4 property and linking it to UA is not exactly a migration – it essentially converts UA’s data structure into the GA4/Firebase format. The existing gtag with the UA-ZZZ will probably continue working, but it will have GA4’s limitations and almost none of the freedom of UA, making it less flexible for use. However, it’s possible that this ‘pseudo’ UA property might be supported after the grace period since Google has consistently indicated the depreciation of UA. However, using this method allows only those tracking features common in both UA and GA4 to be utilized. Best practices suggest keeping front-end developers from directly adjusting the gtag() and recommend using dataLayer as a buffer between front-end and analytics. Thus, using this system allows all front-end code to be reusable, and any migration doesn’t impact the front-end as all remapping can be done within GTM itself. For complex tasks like EEC, GTM templates are available that can convert UA’s EEC dataLayer events into GA4’s format.