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.
BUTTON_CLICKED
is generated each time the widget is successfully opened.DIALOG_CREATED
is generated each time a new dialog is created.<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
PASSIVE_REQUEST
is generated while creating a new dialog, when there are no streamers with "available" status.MISSED_REQUEST
is generated when the streamer response time provided to the customer has expired. By default, the widget then offers an opportunity to subscribe to notifications..STREAM_JOINED
is generated every time a customer connects to a stream.DIALOG_CLOSED
is generated when the conversation is closed by a customer (not a streamer).CHAT_JOINED
is generated when a customer returns to one of the active chats.<aside>
⚠️ If the customer returned to the chat by clicking the button, then both CHAT_JOINED
and BUTTON_CLICKED
are generated.
</aside>
CHAT_OVERLAY_CLOSED
is generated when the customer collapses the widget by clicking the blank area around the widget or the close icon.AUDIO_SENT
is generated every time a customer sends a voice message outside of the stream.VIDEO_CLICKED
is generated every time a customer clicks on a video that the streamer sent to the dialog (not a recorded stream, but a video uploaded by the streamer from the gallery on their device).STREAM_REPLAY_CLICKED
is generated every time a customer clicks on a video recording of the stream.PRODUCT_PAGE_CLICKED
is generated every time a customer clicks on the "Go to product page" button in the upper right corner of the widget if the customer is on a page with a different URL the one where the dialog was opened."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>
DIALOG_RATED
is generated when a customer clicks on the star to rate the streamer's performance.
DIALOG_MARKED_UNRATED
is generated when a customer clicks the "Close without rating" button.
GAME_OPENED
is generated when the "Mini Game" button is clicked.
STREAM_MIC_ON
is generated after the customer has given the widget the access to the microphone and pressed the microphone icon during the stream.
EMAIL_NOTIFICATIONS_ON
is generated when a customer leaves their email for receiving notifications. This does not apply to the request for notifications when there are no available streamers.
PUSH_NOTIFICATIONS_ON
is generated when the customer agrees to receive push notifications. This does not apply to the request for notifications when there are no available streamers.
INTRO_VIDEO_CLICKED
is generated when a customer clicks the play button on the intro video.
CLIENT_FIRST_REPLIED
is generated when the customer sends the first message in the dialogue.
<aside> ⚠️ A buyer can send a message only after the streamer has accepted the request and sent a message in the dialogue or started broadcasting.
</aside>
STREAMER_PUT_IN_CART_ACCEPTED
is generated when a customer accepts the streamer's offer to add a product to their cart.
STREAMER_PUT_IN_CART_DECLINED
is generated when a customer rejects the streamer's offer to add a product to their cart.
PUT_IN_CART_FROM_WIDGET
is generated in two cases: when a customer clicks the "Add item to cart" button in the widget, and when the streamer invites the customer to add an item to their cart during the communication, and the customer accepts.
PUT_IN_CART
is generated by an API call on the host page when the site informs the widget that the item has been added to the cart.
<aside> ⚠️ The point at which an item is considered to be added to the shopping cart depends on your site settings.
</aside>
CART_SUBMITTED
is generated by an API call on the host page when the site informs the widget that an order has been placed.
<aside> ⚠️ The point at which an order is considered completed depends on your site settings.
</aside>
PRODUCT_SOLD_BY_STREAMER
is generated after the host page triggers a CART_SUBMITTED
event for each item sold by the streamer.
PRODUCT_SOLD
is generated after the host page triggers a CART_SUBMITTED
event for each item possibly sold by the streamer.
More: Adding a product to cart and placing an order
APPOINTMENT_CLIENT_ACCEPTED
is generated when a customer confirms a scheduled stream in a pop-up window.
APPOINTMENT_CLIENT_DECLINED
is generated when a customer rejects a scheduled stream in a pop-up window.
APPOINTMENT_CLIENT_CANCEL
is generated when a customer cancels a previously confirmed scheduled stream.
APPOINTMENT_CLIENT_SHOWED_UP
is generated when a customer joins a scheduled stream.
<aside> ⚠️ The widget confirms the customer's presence only when the customer sends the first message in the conversation after the scheduled date of the stream.
</aside>
CLIENT_DATA_UPDATED
is generated every time a request is sent and enables the client's website to collect customers' personal data if they are provided.
All events receive parameters ****title
, target
, buttonId
.
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!
Navigation
Basic stuff
Creating and setting up eyezon button
Placing the button on your website
Advanced stuff
Button and widget appearance, behavior and placement: advanced settings
Collecting customers' personal data
Scheduled stream a.k.a. planned appointment
Adding a product to cart and placing an order
End-to-end analytics with eyezon
Performance dashboard and realtime monitoring
Android SDK Integration Developer Guide