Reference
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
andset
,Lists all the available events on
on
andoff
.
iAdvize.activate / iAdvize.logout
These methods are used for authentication. Please see the dedicated Help Center article : https://help.iadvize.com/hc/articles/6043078724626
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)
)
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)
customData
The current custom data object
object
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.
visitor:cookiesConsent
Whether the visitor consented to cookies or not
true
, false
visitor:GDPRConsent
Whether the visitor consented to GDPR or not
true
, false
customData
Shallow‑merge the provided key/value pairs into the custom data store (accessible via iAdvize.get('customData')
) to enrich targeting, notifications, and conversation payloads. Updates are debounced (~500 ms) and re‑evaluate engagement rules that depend on custom data; related experiences that rely on these values may refresh accordingly.
object
Example :
window.iAdvizeInterface = window.iAdvizeInterface || [];
window.iAdvizeInterface.push(function (iAdvize) {
iAdvize.set('visitor:GDPRConsent', true);
});
Custom data usage examples
Custom data allows you to send real‑time context to iAdvize based on the visitor’s navigation on your website. For example, you can send the product IDs being viewed so that iAdvize can adapt the content of Conversation Starter notifications, and so that the AI Shopping Assistant understands the visitor’s browsing context.
You can also pass other contextual information, such as page type, product categories, or details about the visitor’s identity (when logged in), to personalize the AI Shopping Assistant’s responses (advanced configuration may be required).
There are many other uses for custom data, such as engaging visitors based on these values, or transmitting contextual information about visitors and their conversations to the human agent who will handle them from the Desk.
window.iAdvizeInterface = window.iAdvizeInterface || [];
window.iAdvizeInterface.push(function (iAdvize) {
// Update or add keys. This performs a shallow merge into the custom data store
iAdvize.set('customData', { productId: 'SKU-123' });
});
Updating
customData
reruns engagement rules that depend on custom data and can refresh surfaces that leverage these values (for example, certain notifications or knowledge suggestions). InFULL
tag mode, this also replays pending Conversation Starter rules. This allows experiences that require a product context to appear as soon asproductId
is provided.The merge is shallow (top-level keys only) and debounced (~500ms) to avoid bursts of updates.
Product key mapping: if a knowledge source is configured with a
knowledgeCustomDataKey
, the SDK will read that key from the custom data store. If absent, it falls back toproductId
orproduct_id
when available.Custom data is included when creating a conversation and can be used by multiple features (e.g., targeting, notifications, reporting). Ensure only non-sensitive values are sent.
Reading: prefer
iAdvize.get('customData')
over direct access to the underlying store.Listening:
iAdvize.on('customData', (next, prev) => { /* ... */ })
provides the next and previous values.Supported types for targeting and visitor context:
string
,number
,boolean
, andstring[]
(arrays are serialized as CSV). Nested objects/arrays are not deeply merged (they are replaced) and are ignored for targeting.
Common keys used in implementations
Identity/CRM:
extID
,cust_email
/user_email
,custProfile
.Product context:
productId
,product_id
(or the configuredknowledgeCustomDataKey
).Example remappings (internal):
city_cp
→city
,name_firstname
→name
.
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.
chatbox:statusChange
The status of the chatbox
OPENED
, REDUCED
, CLOSED
(default)
conversation:idChange
The id of the conversation
string
, null
(default)
tag:versionChange
The tag version
"LIGHT"
, "FULL"
visitor:cookiesConsentChange
Whether the visitor consented to cookies or not
true
, false
, null
(default)
visitor:GDPRConsentChange
Whether the visitor consented to GDPR or not
true
, false
, null
(default)
visitor:sourceIdChange
The ID of the visitor
string
, null
(default)
customData
Fired when the custom data object is updated
object
(listener receives next and previous values)
engagementRules:triggeredChange
Get all the triggered rules id on the page
string[]
Array of ids of engagement rules
engagementNotifications:displayedChange
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
Allows to record transactions. See the dedicated article on the Help Center: https://help.iadvize.com/hc/en-gb/articles/206375538
Example :
window.iAdvizeInterface = window.iAdvizeInterface || [];
window.iAdvizeInterface.push(function (iAdvize) {
iAdvize.recordTransaction({
id: 'unique-id',
amount: 49.95,
});
});
iAdvize.navigate
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.
Last updated
Was this helpful?