Skip to main content

Listen to Caast Events

If you want to implement custom analytics or override some Caast behaviour, you may want to start listening to our emitted events. Caast emits a lots of useful events that you may use, the complete list of events is available here.

This example show you how to listen to all our events, but do not hesitate to adapt it to listen only what you need.

In order to start listening to those events, please follow this really simple tutorial:

info

If your listener is behind a cookie consent condition, or is not executed at the same time Caast is loaded, please use this template

var checkExist = setInterval(function () {
if (typeof window.caast !== 'undefined') {
if (typeof window.caastIsListening === 'undefined') {
window.caast
.on('all', function (response) {})
.then(function () {
window.caastIsListening = true;
});
}
clearInterval(checkExist);
}
}, 100);