1. Home
  2. Platform Administration
  3. User Management
  4. How to Use Dispatch Jukebox Events

How to Use Dispatch Jukebox Events

This functionality allows developers to tap into the in-browser events of our Jukebox tracking script.

First, the following Javascript must be enabled on the page you wish to tap into events on. For Content Tracks and Explore Pages add the following code as External Code and enable on the Content Tracks and Explore Pages you wish to tap into.

For Chrome and Firefox

handleJukeboxDispatchedEvents = event => {
        switch (event.detail.eventName) {
          case "load_show":
            // Add custom code here.
            console.info('Load Show Event', event.detail);
          case "mouse_move":
            // Add custom code here.
            console.info('Mouse Move Event', event.detail);
            // Other events not handled are caught here.
            console.info('Other Event', event.detail);

      window.addEventListener("pf_event", this.handleJukeboxDispatchedEvents, false);

For Internet Explorer

handleJukeboxDispatchedEvents = function(event) {
      window.addEventListener("pf_event", this.handleJukeboxDispatchedEvents, false);

The events in the case statement are any event from EventNames.js, which are listed below. For example, you can replace “load_show” or add to the case statement. This is a list of valid events as of April, 2020 and some may be deprecated or new events added over time.

Updated on April 14, 2023

Was this article helpful?

Need Support?
Can't find the answer you're looking for? Don't worry we're here to help!