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?

  • Do I need to modify website code for GA4 property linked to UA to switch from UA- to G-ZZZ?

    Posted by Madison on 27 January 2023 at 12:27 pm

    So, as a frontend developer, I often grapple with GA’s “send instructions” that unfortunately don’t contain any useful information about which property or website it belongs to.

    I’ve been digging through Google’s documentation – there must be a good dozen pages of it – but I can’t seem to find any instructions on reusing code. At the moment, the main step in the migration process is to set up a GA4 property and link it to UA, right? It’s quite straightforward and works like a charm.

    However, the stumbling block for me is that the implementation I’ve been given still includes a gtag + UA-ZZZ. I’ve been wondering, once the six-month grace period ends after 01.07.2023, will I still need to keep the UA-ZZZ or should I switch over to G-ZZZ? Or will the gtag still work with the UA-key, even though GA3(UA) will no longer process data?

    Sophie replied 1 year, 4 months ago 3 Members · 2 Replies
  • 2 Replies
  • Henry

    Member
    14 April 2023 at 5:01 pm

    As a frontend developer, you might be trying to navigate Google’s GA4 switch-over and it certainly comes with its puzzling moments. You’re right in your understanding of having to set up a GA4 property and link it to UA – it’s the first step and generally a simple undertaking.

    You’re not wrong to wonder about the gtag and UA-ZZZ. It’s important to consider that Google will stop processing new data for Universal Analytics properties after July 1, 2023, which means the UA-ZZZ would no longer be practical. From that point, it’ll be all about the new G-ZZZ, aka the GA4 tracking ID.

    If you’re uncertain about the new ID, you can see it for yourself. Just go to your GA4 property, then to Admin, followed by Data Streams. Clicking on View tag instructions and then the Install manually tab will show you that the GA4 tag has followed suit and is now in the G-XXXXXXXXXX format, matching the new measurement ID. So, in the end, it’s all about making that transition in time and getting used to the new normal in Google Analytics!

  • 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.

Log in to reply.