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
  • iAdvize.help
  • iAdvize.activate / iAdvize.logout
  • iAdvize.get
  • iAdvize.set
  • iAdvize.on
  • iAdvize.off
  • iAdvize.recordTransaction
  • iAdvize.navigate

Was this helpful?

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

Reference

PreviousJavascript Web SDKNextJavascript Callbacks

Last updated 5 months ago

Was this helpful?

Method
Description

Displays a list of available commands in the console

Activates the tag with an identity or removes an identity, effectively stopping the tag.

Needed when authentication is enabled.

Getters for retrieving public properties

Getters for defining public properties

Event listeners to watch for changes of specific properties

Remove an event listener

Inform iAdvize that a transaction has occurred on your website

Changes the current screen and restart the tag, allowing a new targeting run

iAdvize.help

  • Lists all the available methods,

  • Lists all the available properties on get and set,

  • Lists all the available events on on and off.

iAdvize.activate / iAdvize.logout

These methods are used for authentication. Please see the dedicated Help Center article :

iAdvize.get

iAdvize.get takes a single property argument, and returns the associated value. Properties are keys that reference values that can change over time. These values can be accessed :

  • directly, using iAdvize.get (ex: iAdvize.get('visitor:cookiesConsent'))

  • when they change, using iAdvize.on (ex: iAdvize.on('visitor:cookiesConsentChange', callback))

Property
Description
Values

chatbox:status

The status of the chatbox

OPENED, REDUCED, CLOSED (default)

conversation:id

The id of the conversation

string, null (default)

tag:version

The tag version

"LIGHT", "FULL"

visitor:cookiesConsent

Whether the visitor consented to cookies or not

true, false, null (default)

visitor:GDPRConsent

Whether the visitor consented to GDPR or not

true, false, null (default)

visitor:sourceId

The ID of the visitor

string, null (default)

engagementRules:triggered

Get all the triggered rules id on the page

string[] Array of ids of engagement rules

engagementNotifications:displayed

Get all the displayed notifications on the page

object[] type: "BADGE", "CLASSIC", "MESSAGING", "INVITATION", "MINI_BADGE", "CHATBOX", "MESSAGE", "CUSTOM_BUTTON", "EMBEDDED_CONVERSATION_STARTER" id (notification id): string ruleId: string channels: ["CHAT", "CALL", "VIDEO", "MESSENGER", "SMS", "WHATSAPP"]

engagementNotifications:controlled

Get all the controlled notifications of a the increment test on the page

object[] type: "BADGE", "CLASSIC", "MESSAGING", "INVITATION", "MINI_BADGE", "CHATBOX", "MESSAGE", "CUSTOM_BUTTON", "EMBEDDED_CONVERSATION_STARTER" id (notification id): string ruleId: string channels: ["CHAT", "CALL", "VIDEO", "MESSENGER", "SMS", "WHATSAPP"]

Example :

window.iAdvizeInterface = window.iAdvizeInterface || [];
window.iAdvizeInterface.push(function (iAdvize) {
  const visitorCookiesConsent = iAdvize.get('visitor:cookiesConsent');
});

iAdvize.set

Set editable properties.

Property
Description
Values

visitor:cookiesConsent

Whether the visitor consented to cookies or not

true, false

visitor:GDPRConsent

Whether the visitor consented to GDPR or not

true, false

Example :

window.iAdvizeInterface = window.iAdvizeInterface || [];
window.iAdvizeInterface.push(function (iAdvize) {
  iAdvize.set('visitor:GDPRConsent', true);
});

iAdvize.on

Listen to a property change.

iAdvize.on takes two arguments :

  • The name of an event,

  • A callback that takes the associated event value and the previous value as parameter.

Property
Description
Values

chatbox:status

The status of the chatbox

OPENED, REDUCED, CLOSED (default)

conversation:id

The id of the conversation

string, null (default)

tag:version

The tag version

"LIGHT", "FULL"

visitor:cookiesConsent

Whether the visitor consented to cookies or not

true, false, null (default)

visitor:GDPRConsent

Whether the visitor consented to GDPR or not

true, false, null (default)

visitor:sourceId

The ID of the visitor

string, null (default)

engagementRules:triggered

Get all the triggered rules id on the page

string[] Array of ids of engagement rules

engagementNotifications:displayed

Get all the notifications displayed on the page

object[] type: "BADGE", "CLASSIC", "MESSAGING", "INVITATION", "MINI_BADGE", "CHATBOX", "MESSAGE", "CUSTOM_BUTTON", "EMBEDDED_CONVERSATION_STARTER" id (notification id): string ruleId: string channels: ["CHAT", "CALL", "VIDEO", "MESSENGER", "SMS", "WHATSAPP"]

engagementRule:triggered

Called when an engagement rule is triggered on the page

string Id of engagement rule

engagementNotification:displayed

Triggered when a notification is displayed on the page

object type: "BADGE", "CLASSIC", "MESSAGING", "INVITATION", "MINI_BADGE", "CHATBOX", "MESSAGE", "CUSTOM_BUTTON", "EMBEDDED_CONVERSATION_STARTER" id (notification id): string ruleId: string channels: ["CHAT", "CALL", "VIDEO", "MESSENGER", "SMS", "WHATSAPP"]

engagementNotification:clicked

Triggered when the notification is clicked

object type: "BADGE", "CLASSIC", "MESSAGING", "INVITATION", "MINI_BADGE", "CUSTOM_BUTTON", "EMBEDDED_CONVERSATION_STARTER" id (notification id): string ruleId: string channel: "CHAT", "CALL", "VIDEO", "MESSENGER", "SMS", "WHATSAPP" text: string (is only filled for the starters, otherwise null)

engagementNotification:controlled

Triggered when the notification is not authorized in the increment test

object type: "BADGE", "CLASSIC", "MESSAGING", "INVITATION", "MINI_BADGE", "CHATBOX", "MESSAGE", "CUSTOM_BUTTON", "EMBEDDED_CONVERSATION_STARTER" id (notification id): string ruleId: string channel: "CHAT", "CALL", "VIDEO", "MESSENGER", "SMS", "WHATSAPP"

Example :

window.iAdvizeInterface = window.iAdvizeInterface || [];
window.iAdvizeInterface.push(function (iAdvize) {
  iAdvize.on('visitor:cookiesConsentChange', function (visitorCookiesConsent, previousValue) {
    // The new value 
    console.log(visitorCookiesConsent);
    // The previous Value
    console.log(previousValue);
  });
});

iAdvize.off

Remove the event listener.

iAdvize.off takes two arguments :

  • The name of an event,

  • A callback that takes the associated event value and the previous value as parameter.

Example :

window.iAdvizeInterface = window.iAdvizeInterface || [];
window.iAdvizeInterface.push(function (iAdvize) {
  const callback = (visitorCookiesConsent, previousValue) => console.log(visitorCookiesConsent, previousValue);
  // Listen the changes
  iAdvize.on('visitor:cookiesConsentChange', callback);
  // Remove the listener
  iAdvize.off('visitor:cookiesConsentChange', callback);
});

iAdvize.recordTransaction

Example :

window.iAdvizeInterface = window.iAdvizeInterface || [];
window.iAdvizeInterface.push(function (iAdvize) {
  iAdvize.recordTransaction({
    id: 'unique-id',
    amount: 49.95,
  });
});

iAdvize.navigate

Argument
Type
Description

path

String

Path/URL you wish to tell iAdvize where the visitor is "virtually" browsing

If part of your web site is built using SPA technology that does not update your browser's history (=your site's url does not change, even though the page displayed to the visitor does), you can simulate a page change using the iAdvize.navigate("YOUR_PATH") method.

This will restart iAdvize's targeting engine to take into account the new URL/path value you enter as parameter.

Allows to record transactions. See the dedicated article on the Help Center:

https://help.iadvize.com/hc/articles/6043078724626
https://help.iadvize.com/hc/en-gb/articles/206375538
help
activate / logout
get
set
on
off
recordTransaction
navigate