Reference

Callback name
Description

Triggered when the chatbox is displayed on the visitor screen (either opened or reduced).

Triggered when a “click to chat” button is displayed on the visitor screen.

Triggered when a chat conversation has started.

Triggered when a chat conversation has ended.

Triggered when a “click to call” button is displayed on the visitor screen.

Triggered when an operator message is received by the visitor.

Triggered when the visitor sends a message.

Triggered when the satisfaction survey is displayed to the visitor.

Triggered when the visitor has answered all the questions in the satisfaction survey.

onChatDisplayed

Triggered when the chat window is displayed on the visitor screen (either opened or reduced).

Example:

window.iAdvizeCallbacks = {
  ...window.iAdvizeCallbacks,
  
  onChatDisplayed() {
    // Chat window is displayed
    ...
  }
  
};

onChatHidden

Triggered when the visitor closes the chatbox (after the conversation has been closed by the operator).

Example:

window.iAdvizeCallbacks = {
  ...window.iAdvizeCallbacks,
  
  onChatHidden() {
    // Chat window is hidden
    ...
  }
  
};

onChatButtonDisplayed

Triggered when a “click to chat” button is displayed on the visitor screen.

Example:

window.iAdvizeCallbacks = {
  ...window.iAdvizeCallbacks,
  
  onChatButtonDisplayed() {
    // Chat button is displayed
    ...
  }
  
};

onChatStarted

Triggered when a chat conversation has started.

Context parameter:

Property
Description

context.id

Legacy conversation ID (integer ID)

context.conversationId

New conversation ID in UUID format that you can use in our GraphQL API

context.vuid

Visitor Unique Id is a random string which can be used for analytics purposes

Example:

window.iAdvizeCallbacks = {
  ...window.iAdvizeCallbacks,
  
  .onChatStarted(context) {
    // Chat conversation has started
    ...
  }
  
};

onChatEnded

Triggered when a chat conversation has ended.

Context parameter:

Property
Description

context.id

Legacy conversation ID (integer ID)

context.endedBy

⚠️ DEPRECATED. The conversation can only be ended by an operator

context.conversationId

New conversation ID in UUID format that you can use in our GraphQL API

context.vuid

Visitor Unique Id is a random string which can be used for analytics purposes

Example:

window.iAdvizeCallbacks = {
  ...window.iAdvizeCallbacks,
  
  onChatEnded(context) {
    // Chat conversation is closed
    ...
  }
  
};

onCallButtonDisplayed

Triggered when a “click to call” button is displayed on the visitor screen.

Example:

window.iAdvizeCallbacks = {
  ...window.iAdvizeCallbacks,
  
  onCallButtonDisplayed() {
    // Call button is displayed
    ...
  }
  
};

onMessageReceived

Triggered when an operator message is received by the visitor.

Context parameter:

Property
Description

context.time

Local time of the message (visitor time)

context.msg

The text message received

context.date

context.operator.id

Internal iAdvize operator id

context.operator.externalId

The operator external id provided by the customer

Example:

window.iAdvizeCallbacks = {
  ...window.iAdvizeCallbacks,
  
  onMessageReceived(context) {
    // Operator message received
    ...
  }
  
};

onMessageSent

Triggered when the visitor sends a message.

Context parameter:

Property
Description

context.time

Local time of the message (visitor time)

context.msg

The text message received

Example:

window.iAdvizeCallbacks = {
  ...window.iAdvizeCallbacks,
  
  onMessageSent(context) {
    // Visitor message sent
    ...
  }
  
};

onSatisfactionDisplayed

Triggered when the satisfaction survey is displayed to the visitor.

Example:

window.iAdvizeCallbacks = {
  ...window.iAdvizeCallbacks,
  
  onSatisfactionDisplayed() {
    // Satisfaction survey displayed to the visitor
    ...
  }
  
};

onSatisfactionAnswered

Triggered when the visitor has answered all the questions in the satisfaction survey.

Example:

window.iAdvizeCallbacks = {
  ...window.iAdvizeCallbacks,
  
  onSatisfactionAnswered() {
    // Satisfaction survey answered by the visitor
    ...
  }
  
};

Last updated

#147: HFE - Authenticated Messaging

Change request updated