The documentation here lists a large collection of JS events that GA4 automatically collects. But the docs don't really specify how & where to integrate the event and the parameters with the GTM dataLayer
model.
I assume by pushing a listed event to the Data Layer we get this out-of-the-box recording, e.g. dataLayer.push({event:'video_start'});
. But even with that, the docs are not clear about where to push the parameter values ... should they all be pushed to the 'top' of the Data Layer, like so?:
dataLayer.push({event:'video_start', video_title:'my title', video_url:'my-url'});
Ideally I'd like to keep the Data Layer somewhat clean by pushing the parameters as sub-props into a single property on the Data Layer with something like:
dataLayer.push({event:'video_start', video_params:{title:'my title', url:'my-url'}});
, and then configure GA4 GTM tags to correctly map the Data Layer variables to the expected GA4 parameters for those events. I know I can disable some amount of automatic event tracking and do this all by hand, but I'd like to first understand exactly how the GTM GA4 tags are working.
I haven't been able to find any official (i.e. from Google) documentation for GA4-via-GTM covering the details about how events and parameters are handled via the Data Layer by the GA4 GTM tags. Does anyone here know how these mappings are handled in the default (i.e. "automatic") cases?