The eyezon event system has two functions. You can use it to customize how the widget works for your business operations. It also allows the eyezon widget to exchange information with other scripts on the page and transfer information about customers' actions into the analytics tools of your choice.

Available event types

<aside> ⚠️ A dialog is created the moment a customer sends a request. If the customer opens and closes the widget without submitting a request, a DIALOG_CREATED event is not generated.

</aside>

eyeZon('on', 'DIALOG_CREATED', function(data) {
 
    if (data.predefinedMessageIndex === 0) {
console.log('DIALOG_CREATED1', data);           
    } else if (data.predefinedMessageIndex === 1) {
       console.log('DIALOG_CREATED2', data);
    }
else
{console.log('DIALOG_CREATED3', data); 
}
})

An example of different actions for different templates

<aside> ⚠️ If the customer returned to the chat by clicking the button, then both CHAT_JOINED and BUTTON_CLICKED are generated.

</aside>

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/4b31c8f5-fe13-465a-854d-e94584e7c9e6/01.png

"Go to product page" button

<aside> ⚠️ Identical URLs have the same text after the top-level domain. For example: https://www.notion.so/eyezon/52c73b0a37a04372b2b7f0401211dd9d

</aside>

All events receive parameters ****title, target, buttonId.

Examples of using events

An example of using the DIALOG_CREATED event in a script:

<script>
    (function (w,d,s,o,f,js,fjs) {
        w[o] = w[o] || function () { (w[o].q = w[o].q || []).push(arguments) };
        js = d.createElement(s); fjs = d.getElementsByTagName(s)[0];
        js.id = o; js.src = f; js.async = true; fjs.parentNode.insertBefore(js, fjs);
    }(window, document, 'script', 'eyeZon', '<https://storage.googleapis.com/eyezonscriptv2/static/js/eyezonwidget.js>'));

    eyeZon('init', {
        businessId: 'YOUR BUSINESS ID'
    });
    
		eyeZon('on', 'DIALOG_CREATED', function(data) {
 
    if (data.predefinedMessageIndex === 0) {
console.log('DIALOG_CREATED1', data);           
    } else if (data.predefinedMessageIndex === 1) {
       console.log('DIALOG_CREATED2', data);
    }
else
{console.log('DIALOG_CREATED3', data); 
}
})
</script>

An example of using the STREAM_JOINED event in a script:

<script>
    (function (w,d,s,o,f,js,fjs) {
        w[o] = w[o] || function () { (w[o].q = w[o].q || []).push(arguments) };
        js = d.createElement(s); fjs = d.getElementsByTagName(s)[0];
        js.id = o; js.src = f; js.async = true; fjs.parentNode.insertBefore(js, fjs);
    }(window, document, 'script', 'eyeZon', '<https://storage.googleapis.com/eyezonscriptv2/static/js/eyezonwidget.js>'));

    eyeZon('init', {
        businessId: 'YOUR BUSINESS ID'
    });
    
		eyeZon('on', 'STREAM_JOINED', function(data) {
		    **console.log('STREAM_JOINED', data)**
				// your most liked function
		});
</script>

Still have got questions? Experiencing a problem? Encountered a bug? Please refer to our customer support team. We are here to help!

Jira Service Management


Navigation

Basic stuff

What is eyezon

Technical requirements

Business account registration

Creating and setting up eyezon button

Placing the button on your website

Streamer team

Streamer experience

Statistics and data

Integration with Shopify

Integration with WordPress

Advanced stuff

Button and widget appearance, behavior and placement: advanced settings

Collecting customers' personal data

Scheduled stream a.k.a. planned appointment

Co-op shopping

Adding a product to cart and placing an order

Smart Routing

Coupons

End-to-end analytics with eyezon

Performance dashboard and realtime monitoring

Android SDK Integration Developer Guide

iOS SDK Integration Developer Guide

Open API

System of events

Security paragraph

Debugging