Custom Code Integration Plugin
The Custom Code Integration Plugin allows you to add JavaScript code into your Digital Assistants and add new interactive features or integrate with third-party systems.
To the Custom Code Integration Plugin, please contact your Zoovu representative or email [email protected].
With the this plugin, you can:
- integrate the assistant with CRM or ERP systems;
- enable advanced personalization;
- extend your analytics and reporting by integrating with Google Analytics, Adobe Analytics, Facebook, and Google AdSense;
- automate workflow triggers based on user actions or predefined criteria (e.g. the “add-to-cart” logic).
Enable the plugin
- Go to Conversation Studio > Experience Designer.
- Go to Theme Settings.
- Enable the CUSTOM EVENTS PLUGIN.
- Add your JS code.
Configure the plugin
The configuration is organized into sections, each containing groups of related events.
The custom JavaScript can access specific data using the this
object. Each event yields an AdvisorModel reflecting the current status of the advisor, enabling the manipulation of the Advisor (this.advisor
) and the event object which includes both "name" and data components.
Here is an example of an event object:
event: {
"name": "answer-select",
"data": {
"description": "User selected \"Yes\"",
"questionType": "RADIO",
"question": "Will the camera be used in any extreme conditions?",
"answer": "Yes",
"selected": true
}
}
And here's how the script might use this information:
if (this.event.data.answer === "Yes") {
this.advisor.flowStepsNavigation.next();
}
The "Before Model Load" phase serves as a hook that allows for the interception of events. It has access to the CustomEventsPlugin
class with access to advisor
, advisorRoorView
, applicationPluginContext
objects.
Answer Events
Triggered when a user selects or deselects an answer in single or multiple-choice questions.
EVENT NAME | EVENT TRIGGER | EVENT DATA |
---|---|---|
Answer Select | Selecting answer in single/multiple | description, questionType, question, answer, selected |
Answer Deselect | Deselecting answer in single/multiple | |
Answer Toggle | Selecting/deselecting in multiple choice |
Comparison Events
Triggered when a user opens the comparison modal, adds a product for comparison, removes a product, or closes the comparison modal.
EVENT NAME | EVENT TRIGGER | EVENT DATA |
---|---|---|
comparison-start | Opening comparison modal | description, products (sku, name) |
comparison-product-select | Adding product for comparison | |
comparison-product-deselect | Removing product from comparison | |
comparison-end | Closing comparison modal |
Leadgen Events
Triggered when a user submits a lead generation form.
EVENT NAME | EVENT TRIGGER | EVENT DATA |
---|---|---|
leadgen-submit | After submitting leadgen form | description |
Navigation Events
These can be triggered by various user actions:
- moving to the next step in the flow, via button or auto-progress;
- returning to a previous step via the "back" button;
- changing steps through navigation;
- clicking the "restart" button.
EVENT NAME | EVENT TRIGGER | EVENT DATA |
---|---|---|
navigation-next | Going to next step (button/auto-progress) | description, page, previousPage, questions |
navigation-back | Going to previous step (back button) | |
navigation-go-to-page | Changing step via navigation | |
navigation-restart | Restarting advisor (restart button) |
Numeric Question Events
Triggered when a new (upper or lower) value is selected on a slider.
EVENT NAME | EVENT TRIGGER | EVENT DATA |
---|---|---|
Upper value selected | Selecting new upper value on double sliders/on load | description, questionType, question, value |
Lower value selected | Selecting new lower value on double sliders/on load | |
Value selected | Selecting new value on single sliders/on load |
Product Events
Triggered by adding a product to the cart or clicking the "go to product" button on a product tile.
EVENT NAME | EVENT TRIGGER | EVENT DATA |
---|---|---|
go-to-product-details | Adding product to cart | description, product (name, SKU) |
add-product-to-cart | Clicking "go to product" on tile | description, product (name, SKU) |
Recommendation Events
Triggered by the product recommendations being fetched on the Results page.
EVENT NAME | EVENT TRIGGER | EVENT DATA |
---|---|---|
recommendations-fetch | On recommendation fetch | description, products (name, SKU) |
Result Page Events
Triggered when the result page is displayed.
EVENT NAME | EVENT TRIGGER | EVENT DATA |
---|---|---|
results-page-show | On result page show | description |
Configurator Events
These can be triggered by a user's interactions with a configurator.
EVENT NAME | EVENT TRIGGER |
---|---|
Summary update | On any selection summary change |
Trigger select | Selecting configurator trigger |
Remove Product from Summary | Removing product from summary |
Add Product To Summary | Adding product to summary |