Using Javascript
Overview on how to fire events on Google Analytics using the Javascript action block.
Step 1: Make sure that the 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
Was this helpful?