Customised or personalised triggers

Customised or personalised triggers

Warning
These instructions are intended for people with a basic understanding of web programming languages: HTML and JavaScript. If this does not apply to you, we recommend that you contact your developers and provide them with these instructions. The installation will be very easy for them. 

Oct8ne triggers allow you to interact with visitors when specific conditions—previously defined in the “Triggers” section of the Oct8ne dashboard—are met (for example: time spent on the page or a specific URL).

But sometimes these conditions aren’t enough to cover very specific scenarios that can occur on certain websites, which is why Oct8ne’s custom triggers were created. Thanks to them, there will no longer be any obstacles when defining the conditions for triggering the chat. We’ll have complete freedom to choose the ideal moment to start a conversation with the visitor.

 But what does it take to create a custom trigger?

Follow the steps below to get everything up and running in just a few minutes. We recommend that the implementation be carried out by your IT team:

1.    Generate dynamic code tailored to your needs:

First, you need to clearly define the conditions that, when met, will open the Oct8ne chat, and control them using JavaScript variables on the different pages of the website where you want the trigger to fire, assigning values to each variable based on how they should respond to user interactions.

Let’s assume we want the Oct8ne chat to open when a visitor’s cart total exceeds €100 and they are in the “Men” product category.
This would involve creating a variable that holds the numerical value corresponding to the sum of the prices of all the products the user has in their cart, and another text variable that holds the name of the product category the user is currently in.

The ultimate goal is for the variables we’re working with to appear as another parameter in the Oct8ne code embedded on our website, within the oct8ne.customData property:


  1. <script type="text/javascript">
  2.       var oct8ne = document.createElement("script");
  3.       oct8ne.type = "text/javascript";
  4.       .....//CódigoMaster oct8ne//
  5.       oct8ne.customData={ cartValue:100, category:"Home" }
  6.        var s = document.getElementsByTagName("script")[0];
  7.       s.parentNode.insertBefore(oct8ne, s);   
  8. </script>


2.    Create a trigger in the Oct8ne Dashboard based on the desired values of our variables:

Once we have finished configuring the variables, we need to go to the Oct8ne dashboard and create a new trigger that includes at least one custom condition (as shown in the dropdown menu in the image). 

We must populate these conditions with the same name we assigned to the object's property and the comparison with the desired value, but it is very important that this matches the data type; in other words, you cannot declare that one string is greater than another because it will not work.  



Warning
Nested properties or sub-objects cannot be evaluated. For example, if the conditions specify that the “cart.value” property must be greater than 100, the system will evaluate the property oct8ne.customData[“cart.value”], NOT the property “value” within “cart”: oct8ne.customData.cart.value.

Some examples of custom conditions, including the case from the previous step:


Info
To compare text values (such as category names), you can use the comparators ‘Contains’, ‘Does not contain’, ‘Starts with’, ‘Ends with’, ‘Does not start with’, and ‘Does not end with’; while for numerical values, you can use ‘Equals’, ‘Greater than’, and ‘Less than’. 
You can also check whether the parameter has been added at all, regardless of its value, using ‘Exists’ and ‘Does not exist’.


How to update variable values in real time.

The values of properties defined as conditions are typically evaluated when the page loads and do not change until the page is updated or reloaded.
If you want to update a value based on an event that has occurred on the page and evaluate it to determine whether a trigger should be fired, you can call the following method:

  1.  oct8ne.updateTriggerValue (propertyName, newValue)

For example, if we have defined the variable 'oct8ne.customData.cartValue=0', and the visitor adds a product to the cart using Ajax, we can call the above method as follows:

oct8ne.updateTriggerValue ("cartValue", 150).

This call will update its value to 'oct8ne.customData.cartValue=150' and re-evaluate the triggers to see if any need to be fired, since the value has been modified. 

    • Related Articles

    • Oct8ne custom widget design

      WHAT IS THE EMBED LINK? Developers can create custom links to access the Oct8ne coviewer. This allows you to have more flexibility when adding visuals to your website to make it attractive and encourage your potential customers to contact agents for ...
    • Oct8ne API for custom CSM integration

      Oct8ne API documentation API version 2.4 Contents 1. Introduction 2. Architecture 3. Overview 3.1. Downloading and installing plug-ins and extensions 3.2. Registering as a developer and enabling the platform 3.3. Inserting the oct8ne widget 3.4. ...
    • Integration with Google Analytics version 4 (GA4)

      Introduction Oct8ne allows direct integration with Google Analytics version 4 (GA4) through event submission. These provide vital information about the interactions that take place within Oct8ne, which you can check in your Google Analytics ...
    • Bot Instruction Manual for Web and Messaging

      TABLE OF CONTENTS 1. OVERVIEW 1.1. Flow Designer 2. WEB BOT: GETTING STARTED 2.1. Create a conversation 2.2. Specific tools in the conversation designer 2.3. Turning the Bot on and off 3. BOT MESSAGING: GETTING STARTED 3.1. Create a conversation 3.2. ...
    • API for sending transactional or bulk messages from WhatsApp

      Introduction WhatsApp Delivery API allows you to automate the delivery of WhatsApp templates via Oct8ne. The following operations are available: Send template to WhatsApp Get delivery status Get deliveries Get message details Security All API calls ...