I want to be able to listen to the widget open event when opening the chat interface
Hi @wz3,
Thank you for asking the Community!
I’d like to share some documentation that I found for you that might help:
- Using widget events
- Hubspot chat widget events not working
I also wanted to invite a couple of subject matter experts to this conversation: Hi @AustinR, @awright415, @piersg, @Mike_Eastwood and @mangelet do you have suggestions to help @wz3, please?
Also, if anybody else has anything to add and/or share, please feel free to join in the conversation ![]()
Thanks a lot and have a brilliant day!
Best,
Bérangère
Hi ! Anything new ? I also need this feat please ![]()
window.addEventListener('message', e => {
if (!e.data || 'string' !== typeof e.data) {
return
}
var data = JSON.parse(e.data)
if (!data.type || 'open-change' !== data.type) {
return
}
if (data.data.isOpen) {
// whatever you wanna do when opening
} else {
// whatever you wanna do when closing
}
})