I'm trying to add GA4 to my site alongside Universal Analytics (GA3) - I'm not using Tag Manager. I've copied the JS from the 'Web stream details' section of the GA console and placed it in the . The Universal Analytics code loads later in the page and is working as expected - data is visible in the GA console.
Initially I tested the GA4 code using https://tagassistant.google.com/ and all of the events showed up in the debug view in the GA console:
- view_item_list
- select_item
- view_item
- generate_lead
- view_cart
- add_to_cart
- remove_from_cart
- begin_checkout
- add_shipping_info
- add_payment_info
- purchase
- refund
When I opened the dev tools and filter network traffic using 'collect' I can see both GA3 and GA4 events. If I filter using 'collect?v=2' I only see GA4 events.
If I then open the same site without using https://tagassistant.google.com/ I only see page_view and user_engagement events - none of the above events in the dev tools and they don't show in the GA console - even days later.
I installed a Chrome extension called 'datalayer checker', which shows all of the expected data. Calling window.dataLayer also shows the same expected data.
In debug view, everything works, when running live it doesn't work. I've verified that the events contain the required properties.
Has anyone else experienced this? Or suggest a possible cause?