Using Javascript
Overview on how to fire events on Google Analytics using the JavaScript action block.
Step 1: Make Sure Google Analytics 4 Code Snippet is Present
Step 2: Add the JavaScript Block on the Chatbot Flow
window.dataLayer = window.dataLayer || [];
function gtag() {
window.dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "YOUR-MEASUREMENT-ID");
gtag("event", "YOUR-EVENT-NAME", {
"send_to": "YOUR-MEASUREMENT-ID"
// ADDITIONAL PARAMETERS THAT YOU MAY WANT TO PASS
});
Last updated