Ad Event Verification

Use JW Player's API to detect and verify when advertising events occur.

License: Enterprise
Player Version:
Author: JW Player | GitHub
This demo includes:
  • on('adImpression')
  • on('adClick')
  • on('adComplete')
  • on('adTime')
  • on('adSkipped')
 

(no ad impression yet)

(no ad progress yet)

(no ad click yet)

(no ad skip yet)

(no ad complete yet)

<script type="text/javascript">

var playerInstance = jwplayer("myElement");

playerInstance.on('adImpression',function(event){
  setElement("impression","The ad impression was fired.");
});

playerInstance.on('adSkipped',function(event){
  setElement("skip","The ad was skipped.");
});

playerInstance.on('adTime',function(event) {
  var remaining = Math.round(event.duration-event.position);
  setElement("progress","The ad completes in "+remaining+" seconds.");
});

playerInstance.on('adClick',function(event){
  setElement("click","The user clicked the ad.");
});

playerInstance.on('adComplete',function(event){
  setElement("complete","The ad was completely watched.");
});

function setElement(element,message){
  var div = document.getElementById(element);
  div.innerHTML = message;
  div.style.color = "#090";
}
</script>
Please Note: This player implementation is a Proof of Concept only provided to show the possibilities of the JW Player and Platform and should not be taken as an offer to create, edit or maintain custom integration or development.