Adding actions to the giosg visitor chat client
Adding actions to the giosg visitor chat client¶
Introduction¶
In this tutorial we will guide you through the process of adding code snippets to be executed when the giosg visitor chat client fires events. You will need to include the giosg script to your webpage to be able to use these snippets.
We have the following actions available to listen to:
Events¶
Chat¶
Room join¶
Note
This event fires every time a visitor is invited into a different room and joins it.
The following snippet will be executed every time the visitor joins a room.
1 2 3 4 5 |
|
Room leave¶
Note
This event fires every time a visitor leaves a room.
The following snippet will be executed every time the visitor leaves a room.
1 2 3 4 5 |
|
Chat is being opened¶
The following snippet will be executed every time the chat window is opened.
1 2 3 4 5 |
|
Chat is being closed¶
The following snippet will be executed every time the chat window is closed.
1 2 3 4 5 |
|
Chat Button Clicked¶
The following snippet will be executed every time the giosg chat button is clicked.
1 2 3 4 5 6 |
|
Message received¶
The following snippet will be executed every time a visitor receives a message.
1 2 3 4 |
|
Message send¶
The following snippet will be executed every time the visitor sends a message.
1 2 3 4 5 6 |
|
Active chat (Changed)¶
The following snippet will be executed when the active chat changes.
1 2 3 4 5 |
|
Active chat (Get)¶
The following snippet will be executed when the active chat is selected.
1 2 3 4 5 |
|
Chat Textarea Focused¶
The following snippet will be executed when the chat textarea is focused by the visitor.
1 2 3 4 |
|
Calls¶
Call initiated¶
The following snippet will be executed every time a call is initiated.
1 2 3 4 5 |
|
Call answered¶
The following snippet will be executed every time a call has been answered.
1 2 3 4 |
|
Call declined¶
The following snippet will be executed every time a call has been declined.
1 2 3 4 |
|
Call audio started¶
The following snippet will be executed when the audio has started between visitor and user.
1 2 3 4 5 |
|
Call video started¶
The following snippet will be executed when video has started between visitor and user.
1 2 3 4 5 |
|
Call ended¶
The following snippet will be executed when the active call is ended by either visitor or user.
1 2 3 4 |
|
Call states¶
The following snippet will be executed when the call has started initializing and contains the state of the call.
1 2 3 4 5 6 7 |
|
Cobrowse¶
Cobrowse started¶
The following snippet will be executed when cobrowse has started.
1 2 3 4 |
|
Cobrowse ended¶
The following snippet will be executed when cobrowse has ended.
1 2 3 4 |
|
Cobrowse declined¶
The following snippet will be executed when cobrowse has declined.
1 2 3 4 |
|
User¶
User presences¶
The following snippet will be executed every time the user & room information changes.
1 2 3 4 5 6 |
|
Online user count changes¶
The following snippet will be executed every time a user changes state in giosg console.
1 2 3 4 5 6 |
|
Online user details¶
The following snippet will be executed every time a user changes state in giosg console.
1 2 3 4 5 6 |
|
Visitor¶
Visitor is active¶
The following snippet will be executed every time the visitor comes out of idle.
1 2 3 4 |
|
Visitor is idle¶
The following snippet will be executed every time idles out.
1 2 3 4 |
|
Conclusion¶
You have now learnt how to add code snippets to our page, to be executed every time one of those events fires.