Developer Platform
  • Home
  • Getting Started
    • General Information
    • Features Overview
    • Security
  • APPs
    • Public Apps
      • Shopify
      • Salesforce
      • Zendesk
      • Google Analytics
    • Build your App
      • Getting started
      • My Apps
      • App information
      • App Parameters
      • App Plugins
      • Add Webhooks
      • Submit your Apps
      • App security
      • Developer Policy
  • Use Cases
    • Copilots
      • Product Catalog sync through API
      • FAQ sync through API
    • Visitor experience
      • Integrating custom buttons into your site
      • Check availability before escalating to iAdvize
      • Authenticated Messaging
        • Introduction
        • Web client-side implementation
          • Authenticated Messaging overview
          • Brief timeline of the integration process
          • How to enable authenticated mode in the administration portal?
          • How to implement the customer authentication backend (token provider)?
          • How to authenticate with iAdvize in client's website?
          • How to deal with activation success or failure?
          • How to logout?
          • Compatibility with Mobile SDK
          • FAQ
        • Web backend implementation
          • Important information and recommendations
          • Signature and Encryption Detailed Process
          • Technical backend implementation
          • FAQ
      • Cross-domain Conversation Continuity
      • Customize replies with Markdown
    • Agent workspace
      • Custom App example and step-by-step tutorial
        • Get Started
        • Work with the Desk
        • Intent / Trigger
        • JWT
        • References
    • Administration
      • Users
        • SAML SSO Authentication - Implementation Guide
        • Create, update and delete users via API
        • Manage the availability of your users with the iAdvize API
        • Integrate the iAdvize conversation panel into an existing tool
    • Data & Analytics
      • Anonymize a conversation or visitor data
      • Create a custom dashboard
      • Find contact data using GraphQL
      • Retrieve conversations data
      • Retrieve messages exchanged within a conversation
  • Technologies
    • GraphQL API
      • Terminology
      • Reference
      • Authentication
      • Schema lifecycle
      • Error Management
      • Pagination
    • REST API (deprecated)
      • Statistic (deprecated)
      • Group (deprecated)
      • Call meeting (deprecated)
      • Operator (deprecated)
      • Skill (deprecated)
      • Transaction (deprecated)
      • Visitor (deprecated)
    • Webhooks
      • Reference
      • Guides
    • Desk events
      • Reference
    • Web & Mobile SDK
      • Javascript Web SDK
        • Reference
      • Javascript Callbacks
        • Reference
        • Guides
      • Mobile SDK
        • Fourme (latest)
        • Epoisses
        • Dauphin
        • Cantal
        • 🤝Support Policy
        • 🤔Frequently Asked Questions
    • Custom App
    • External Bot
      • Implementation
        • Configuration flow
        • Conversation flow
        • Conversation objects
      • Configuration
      • FAQ
      • Best practices
Powered by GitBook
On this page
  • onChatDisplayed
  • onChatHidden
  • onChatButtonDisplayed
  • onChatStarted
  • onChatEnded
  • onCallButtonDisplayed
  • onMessageReceived
  • onMessageSent
  • onSatisfactionDisplayed
  • onSatisfactionAnswered

Was this helpful?

  1. Technologies
  2. Web & Mobile SDK
  3. Javascript Callbacks

Reference

Callback name
Description

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

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

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
    ...
  }
  
};
PreviousJavascript CallbacksNextGuides

Last updated 9 months ago

Was this helpful?

Local DateTime of the message ()

ISO 8601
onChatDisplayed
onChatHidden
onChatButtonDisplayed
onChatStarted
onChatEnded
onCallButtonDisplayed
onMessageReceived
onMessageSent
onSatisfactionDisplayed
onSatisfactionAnswered