Skip to main content

Emitted events

The Caast Library emits a lots of custom events in order to implement code on your side. Those events are emitted on each widget action and return some custom data. Please refer to the data section if you want details about what information is available.

In order to implement events listener on your website, please simply follow this simple tutorial:

All events

This event is emitted when any other event is triggered. It returns an object containing two attributes: type (with the received event name) and data (with the event data).

caast.on('all', function (response) {
console.log('your custom function receiving the response', response);
});

onSetUser

This event is emitted when the setUser method is triggered.

caast.on('onSetUser', function (response) {
console.log('your custom function receiving the response', response);
});

onCookiesAccepted

This event is emitted when the cookiesAccepted method is triggered.

caast.on('onCookiesAccepted', function (response) {
console.log('your custom function receiving the response', response);
});

onCookiesRejected

This event is emitted when the cookiesRejected method is triggered.

caast.on('onCookiesRejected', function (response) {
console.log('your custom function receiving the response', response);
});

onRouteChange

This event is emitted when a Single Page App change current url.

caast.on('onRouteChange', function (response) {
console.log('your custom function receiving the response', response);
});

onLiveSubscription

This event is emitted when a user has subscribed to a live in order to be notified when a live is about to start. Please refer to contentId for additional returned data.

caast.on('onLiveSubscription', function (response) {
console.log('your custom function receiving the response', response);
});

onLivePlay

This event is emitted when a user press play on the Caast Player. Please refer to contentId and player for additional returned data.

caast.on('onLivePlay', function (response) {
console.log('your custom function receiving the response', response);
});

onLivePause

This event is emitted when a user press pause on the Caast Player. Please refer to contentId and player for additional returned data.

caast.on('onLivePause', function (response) {
console.log('your custom function receiving the response', response);
});

onLoadedMetaData

This event is emitted when a content is fully loaded in the Caast Player. Please refer to contentId and player for additional returned data.

caast.on('onLoadedMetaData', function (response) {
console.log('your custom function receiving the response', response);
});

onQuestionClick

This event is emitted when a user click on a question. Please refer to question_id for additional returned data.

caast.on('onQuestionClick', function (response) {
console.log('your custom function receiving the response', response);
});

onProductClick

This event is emitted when a user click on a product to jump to its presentation on a replay. Please refer to product_id for additional returned data.

caast.on('onProductClick', function (response) {
console.log('your custom function receiving the response', response);
});

onProductDetailsClick

This event is emitted when an user click to see product's details. Please refer to product_id for additional returned data.

caast.on('onProductDetailsClick', function (response) {
console.log('your custom function receiving the response', response);
});

onProductDetailsShow

This event is emitted after the product's details is displayed inside Caast. Please refer to product_id, product_ref and product_detailed for additional returned data.

caast.on('onProductDetailsClick', function (response) {
console.log('your custom function receiving the response', response);
});

onProductDetailsClose

This event is emitted after the product's details is closed inside Caast. Please refer to product_id, product_ref and product_detailed for additional returned data.

caast.on('onProductDetailsClose', function (response) {
console.log('your custom function receiving the response', response);
});

onProductOpen

This event is emitted when a user click on the button to go to the product page. Please refer to contentId, product_id, product_ref and product_detailed for additional returned data.

caast.on('onProductOpen', function (response) {
console.log('your custom function receiving the response', response);
});

onProductLoaded

This event emitted once the products linked to the content are fully loaded. Please refer to products and productTimestamps for additional returned data.

caast.on('onProductLoaded', function (response) {
console.log('your custom function receiving the response', response);
});

onRelatedClick

This event is emitted when a user click on a related replay video. Please refer to relatedNextContentId, relatedCurrentContent and relatedCurrentContentId for additional returned data.

caast.on('onRelatedClick', function (response) {
console.log('your custom function receiving the response', response);
});

onMessageSubmit

This event is emitted when a user submit a message in Caast Chat. Please refer to message for additional returned data.

caast.on('onMessageSubmit', function (response) {
console.log('your custom function receiving the response', response);
});

onBasketAdd

This event is emitted when a user add an item to cart, this event can be emitted by a custom selector on the webpage add to cart button or via the Caast Widget direct add to cart action. This event won't be emitted if the target DOM element or the direct add to cart action is not set in the app configuration. Please refer to contentId, product_id, product_ref, product_detailed and from_caast for additional returned data.

caast.on('onBasketAdd', function (response) {
console.log('your custom function receiving the response', response);
});

onModalTrigger

This event is emitted when a user click on the button to open the modal. Please refer to contentId for additional returned data.

caast.on('onModalTrigger', function (response) {
console.log('your custom function receiving the response', response);
});

onModalShow

This event is emitted when the live modal is opened. Please refer to contentId for additional returned data.

caast.on('onModalShow', function (response) {
console.log('your custom function receiving the response', response);
});

onModalClose

This event is emitted when the live modal is closed. Please refer to contentId for additional returned data.

caast.on('onModalClose', function (response) {
console.log('your custom function receiving the response', response);
});

onReminderClick

This event is emitted when the user click on the reminder button. Please refer to contentId for additional returned data.

caast.on('onReminderClick', function (response) {
console.log('your custom function receiving the response', response);
});

onPhoneReminderClick

This event is emitted once the user is inside the reminder dropdown and click on the phone reminder option. Please refer to contentId for additional returned data.

caast.on('onPhoneReminderClick', function (response) {
console.log('your custom function receiving the response', response);
});

onPhoneReminderSubmitted

This event is emitted when the user successfully send his phone number to get a reminder when the live will starts. Please refer to contentId for additional returned data.

caast.on('onPhoneReminderSubmitted', function (response) {
console.log('your custom function receiving the response', response);
});

onEmailReminderClick

This event is emitted once the user is inside the reminder dropdown and click on the email reminder option. Please refer to contentId for additional returned data.

caast.on('onEmailReminderClick', function (response) {
console.log('your custom function receiving the response', response);
});

onEmailReminderSubmitted

This event is emitted when the user successfully send his email to get a reminder when the live will starts. Please refer to contentId for additional returned data.

caast.on('onEmailReminderSubmitted', function (response) {
console.log('your custom function receiving the response', response);
});

onGoogleCalendarClick

This event is emitted once the user is inside the reminder dropdown and click on the Google Calendar option. Please refer to contentId for additional returned data.

caast.on('onGoogleCalendarClick', function (response) {
console.log('your custom function receiving the response', response);
});

onOutlookCalendarClick

This event is emitted once the user is inside the reminder dropdown and click on the Outlook calendar option. Please refer to contentId for additional returned data.

caast.on('onOutlookCalendarClick', function (response) {
console.log('your custom function receiving the response', response);
});

onShare

This event is emitted once the user share the live using one of caast UI element. Please refer to share for additional returned data.

caast.on('onShare', function (response) {
console.log('your custom function receiving the response', response);
});

onReaction

This event is emitted once the user click on an emoji to react during a live. Please refer to contentId and emoji for additional returned data.

caast.on('onReaction', function (response) {
console.log('your custom function receiving the response', response);
});

onExtensionDetailsClick

This event is emitted when an extension card or announcement is clicked. Please refer to extensionDetails for additional returned data.

caast.on('onExtensionDetailsClick', function (response) {
console.log('your custom function receiving the response', response);
});

onExtensionDetailsShow

This event is emitted when an extension iframe has finished loading. Please refer to extensionDetails for additional returned data.

caast.on('onExtensionDetailsShow', function (response) {
console.log('your custom function receiving the response', response);
});

onExtensionDetailsClose

This event is emitted when an extension sidebar is closed. Please refer to extensionDetails for additional returned data.

caast.on('onExtensionDetailsClose', function (response) {
console.log('your custom function receiving the response', response);
});

onExtensionCopyElement

This event is emitted when an extension copy link is clicked. Please refer to extensionDetails for additional returned data.

caast.on('onExtensionCopyElement', function (response) {
console.log('your custom function receiving the response', response);
});

onExtensionOpenSidebar

This event is emitted when an extension is opened inside an iframe. This event is emitted just before onExtensionDetailsShow. Please refer to extensionDetails for additional returned data.

caast.on('onExtensionOpenSidebar', function (response) {
console.log('your custom function receiving the response', response);
});

This event is emitted when an extension link is clicked. Please refer to extensionDetails for additional returned data.

caast.on('onExtensionOpenLink', function (response) {
console.log('your custom function receiving the response', response);
});

onHighlightInView

This event is emitted when an highlight first appear in view of a user. Please refer to contentId and content for additional returned data.

caast.on('onHighlightInView', function (response) {
console.log('your custom function receiving the response', response);
});

onCollectionInView

This event is emitted when a collection first appear in view of a user. Please refer to collectionId for additional returned data.

caast.on('onCollectionContentChange', function (response) {
console.log('your custom function receiving the response', response);
});

onCollectionOpen

This event is emitted when a collection item is clicked. Please refer to collectionId and contentId for additional returned data.

caast.on('onCollectionOpen', function (response) {
console.log('your custom function receiving the response', response);
});

onCollectionContentChange

This event is emitted when a collection content is changed (autoplay or click/swipe). Please refer to collectionCurrentContentId and collectionNextContentId for additional returned data.

caast.on('onCollectionContentChange', function (response) {
console.log('your custom function receiving the response', response);
});

onReviewStarRating

This event is emitted when a user rates a live. Please refer to rating and contentId for additional returned data.

caast.on('onReviewStarRating', function (response) {
console.log('your custom function receiving the response', response);
});

onReviewDetailsAdded

This event is emitted when a user rates a live. Please refer to contentId for additional returned data.

caast.on('onReviewDetailsAdded', function (response) {
console.log('your custom function receiving the response', response);
});

onSurveyShow

This event is emitted when a survey is pushed during a live. Please refer to survey for additional returned data.

caast.on('onSurveyShow', function (response) {
console.log('your custom function receiving the response', response);
});

onSurveyVote

This event is emitted when a user select a survey choice during a live. Please refer to survey and surveyAnswer for additional returned data.

caast.on('onSurveyVote', function (response) {
console.log('your custom function receiving the response', response);
});

onSurveyClose

This event is emitted when a survey is closed manually or automatically during a live. Please refer to survey for additional returned data.

caast.on('onSurveyClose', function (response) {
console.log('your custom function receiving the response', response);
});

onFloatingShow

This event is emitted when a floating is displayed on screen. Please refer to contentId, content, floating and floatingId for additional returned data.

caast.on('onFloatingShow', function (response) {
console.log('your custom function receiving the response', response);
});

onFloatingOpen

This event is emitted when a floating is opened. Please refer to contentId, content, floating and floatingId for additional returned data.

caast.on('onFloatingOpen', function (response) {
console.log('your custom function receiving the response', response);
});

onFloatingClose

This event is emitted when a survey is closed. Please refer to contentId, content, floating and floatingId for additional returned data.

caast.on('onFloatingClose', function (response) {
console.log('your custom function receiving the response', response);
});

onIntegrationsLoaded

This event is emitted when caast has successfully injected the contents on the page. Please refer to integrations and integrationsIds for additional returned data.

caast.on('onIntegrationsLoaded', function (response) {
console.log('your custom function receiving the response', response);
});