GA 4 and DataLayer

Send events into GA4 from DataLayer

5min
how to send default serviceform events into ga4 from datalayer by default serviceform chatbots and forms send the following events to datalayer interaction 'chat start' interaction with any chatbot lead 'chat complete' lead / submission practically chat is completed live chat 'live chat' a live chat between agent and end user redirect 'redirect' redirect from a chatbot or form to any outside or in page url practically they are sent as datalayer events for example window\ datalayer = window\ datalayer || \[]; window\ datalayer push({ 'event' 'serviceform', 'chatprogress' 'live chat' }); to use these in google tag manager, all you need to do is add a trigger and tag 1\ add a trigger this should have the event name from the datalayer push before serviceform you should set it to trigger on all custom events now all default serviceform events are triggering this trigger 2\ add a tag tag type google analytics ga4 event add your configuration tag, or your configuration measurement id (you can find this in your ga 4 admin data streams website settings) and event parameters you can modify these to your needs in the example we use the event name {{dlv chatprogress}} which will be any of the values mentioned before based on the users trigger for example live chat, chat started, chat complete, redirect 3\ check your data double check that your data comes through to google analytics as wanted customise due to the power of google tag manager you can also customise these much further by adding logic to the tag configuration you could for example change event name serviceform {{dlv chatprogress}} to make separation from your other events