google-analyticsgoogle-tag-manageruniversal-analyticsgoogle-analytics-4

Google Analytics duplicate purchase reports


We are trying to setup GA4 analytics without removing (at the moment) the previously setup UA, a scenario which is described on the official documentation : [UA→GA4] Send events to both your UA and GA4 properties

Our problem is that specifically for the purchase event which is a default tag, we see duplicated reports in GA4 Ecommerce Purchases. I suppose that this might be expected since we push 2 purchase events to the dataLayer as described in the following 2 docs for each version respectively:

  1. Universal Analytics (Tag Manager) - Measuring Purchases
  2. GA4 Ecommerce - purchase

It seems like the GA4 report is picking up both purchase events, despite the fact that we use a different model for each event push. So for example in the end we get :

Is there any way we can use both UA and GA4 and be able to remove the duplicate purchase events on our reports somehow? Tried removing one of the 2 dataLayer push events but then one of the 2 reports (GA4/UA) is missing information.


Solution

  • Well, just make a CJS variable that would parse the event's content and indicate whether this payload has UA or GA4 structure. Then utilize the var as a check right in the GA4 EEC trigger. Actually, I would update the GA3 UA EEC trigger too, just in case it suddenly is able to consume the GA4 object.

    But your general approach is sub optimal. How analytics agencies do this kind of job is by reusing the old UA DL pushes and sending the EEC payloads manually rather than through automated DL EEC tracking. As benefits:

    1. Your dataLayer still looks well and uncluttered by duplicate e-commerce information.
    2. You don't bother front-end devs with extra work and it's easier to maintain
    3. Much easier to introduce symmetrical changes especially when you want to introduce, say, a new product- or EEC hit-level custom dimension or metric.
    4. Data parity does not depend on the front-end devs, only on the GTM config.
    5. Less tags/triggers cluttering in GTM.
    6. It's way-way-way faster to do it when you already have a template GTM container for such mapping. Not sure if the agencies share the containers yet though.

    Cons:

    1. A bit more code in GTM.
    2. If GA3 breaks, GA4 will inherit the breakage automatically. Data parity is a double-edged sword.

    I can't share my containers, unfortunately, but they look similar to this: https://github.com/gtm-templates-knowit-experience/ga-eec-to-ga4-ecom-converter/blob/main/template.tpl feel free to give it a shot and let us know if it does the trick.