CRM

wz3
Member

How to listen for widget open events

SOLVE

I want to be able to listen to the widget open event when opening the chat interface

1 Accepted solution
BérangèreL
Solution
Community Manager
Community Manager

How to listen for widget open events

SOLVE

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


HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Learn More.


Saviez vous que la Communauté est disponible en français?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres! !

View solution in original post

0 Upvotes
3 Replies 3
TheD
Participant

How to listen for widget open events

SOLVE
            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
                }
            })
0 Upvotes
TheD
Participant

How to listen for widget open events

SOLVE

Hi ! Anything new ? I also need this feat please 🙂

0 Upvotes
BérangèreL
Solution
Community Manager
Community Manager

How to listen for widget open events

SOLVE

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


HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Learn More.


Saviez vous que la Communauté est disponible en français?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres! !
0 Upvotes