JavaScript events

The Boxzilla plugin comes with several JavaScript events for you to hook into whenever certain box events occur.

You can run register your JavaScript functions by calling the Boxzilla.on( eventName, callback ) function. When the specified box event occurs, your function will be executed.

Here's an example where we run a function whenever a box is shown to a visitor.

Boxzilla.on('', function(box) {
   console.log("Showing box " +;

Available events

The following events are available.

ready Fires after Boxzilla is done initialising Fires when a box becomes visible
box.dismiss Fires when a box is manually dismissed
box.hide Fires when a box is hidden


The following example demonstrates how to track an event with Hubspot.

var _hsq = window._hsq = window._hsq || [];
_hsq.push(["trackEvent", {
    id: "BOXZILLA_SHOW",

Was this article helpful? ·