Sending ping events

Last update: 2024-12-13
  • Created for:
  • User
    Admin
    Developer

You must fire ping events every 10 seconds, beginning after 10 seconds of playback, regardless of other API events that you have sent. This applies for both main content and ad tracking.

The ping events are the “heartbeat” of the Streaming Media Collection. The only required parameters for a ping call are eventType: ping along with the playerTime object (playhead position and timestamp).

The following code snippet shows one way to implement a timed pinging mechanism for main content (10 second interval):

...
Pinger.init(10000);
...
Pinger.kill();

var Pinger = {
    init: function(interval) {
        this._timer = window.setInterval(function() {
                $.event.trigger({type: "onPing", _data: ""});
            }, interval);
    },

    kill: function() {
        window.clearInterval(this._timer);
    }
}

On this page