Sending ping events sending-ping-events

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 literally the “heartbeat” of Media Analytics. 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);
    }
}
recommendation-more-help
c8eee520-cef5-4f8c-a38a-d4952cfae4eb