Skip to main content

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).

Plugin

Enable the plugin

  • Go to Conversation Studio > Experience Designer.
  • Go to Theme Settings.
  • Enable the CUSTOM EVENTS PLUGIN.
  • Add your JS code.

Plugin

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();
}

Plugin

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 NAMEEVENT TRIGGEREVENT DATA
Answer SelectSelecting answer in single/multipledescription, questionType, question, answer, selected
Answer DeselectDeselecting answer in single/multiple
Answer ToggleSelecting/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 NAMEEVENT TRIGGEREVENT DATA
comparison-startOpening comparison modaldescription, products (sku, name)
comparison-product-selectAdding product for comparison
comparison-product-deselectRemoving product from comparison
comparison-endClosing comparison modal

Leadgen Events

Triggered when a user submits a lead generation form.

EVENT NAMEEVENT TRIGGEREVENT DATA
leadgen-submitAfter submitting leadgen formdescription

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 NAMEEVENT TRIGGEREVENT DATA
navigation-nextGoing to next step (button/auto-progress)description, page, previousPage, questions
navigation-backGoing to previous step (back button)
navigation-go-to-pageChanging step via navigation
navigation-restartRestarting advisor (restart button)

Numeric Question Events

Triggered when a new (upper or lower) value is selected on a slider.

EVENT NAMEEVENT TRIGGEREVENT DATA
Upper value selectedSelecting new upper value on double sliders/on loaddescription, questionType, question, value
Lower value selectedSelecting new lower value on double sliders/on load
Value selectedSelecting 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 NAMEEVENT TRIGGEREVENT DATA
go-to-product-detailsAdding product to cartdescription, product (name, SKU)
add-product-to-cartClicking "go to product" on tiledescription, product (name, SKU)

Recommendation Events

Triggered by the product recommendations being fetched on the Results page.

EVENT NAMEEVENT TRIGGEREVENT DATA
recommendations-fetchOn recommendation fetchdescription, products (name, SKU)

Result Page Events

Triggered when the result page is displayed.

EVENT NAMEEVENT TRIGGEREVENT DATA
results-page-showOn result page showdescription

Configurator Events

These can be triggered by a user's interactions with a configurator.

EVENT NAMEEVENT TRIGGER
Summary updateOn any selection summary change
Trigger selectSelecting configurator trigger
Remove Product from SummaryRemoving product from summary
Add Product To SummaryAdding product to summary