Hi community members,
Need some help as I am trying to work with Dialogflow Messenger JavaScript events. I am able to get the below code working pasting it after the tag:
window.addEventListener(‘df-chat-open-changed’, (event) => {
console.log(Chat is ${event.detail.isOpen ? ‘open’ : ‘closed’});
});
Similarly, I am trying another event but this isn’t working for some reason:
window.addEventListener(‘df-messenger-loaded’, () => {
console.log(“DF chat got loaded.”);
});
If I can get the second event working, the aim is to send the first “Hi” message automatically and then pass a string as a session parameter to Dialogflow, which I am going to use later in a webhook. Just wondering if I can get some guidance around this