Tracking events
Implementation
You have to add the following script above the Genoa video iframe:
//Here comes the iframe
<iframe src="your video source" frameborder="0" allowfullscreen width="650" height="390" scrolling="no"></iframe>
<script type="text/javascript">
function isJson(str) {
try {
JSON.parse(str);
} catch (e) {
return false;
}
return true;
}
window.onmessage = function(e){
if(isJson(e.data)){
var pass_data = JSON.parse(e.data);
console.log(pass_data);
}
};
</script>
Response example
The following example shows the JSON response from the Genoa iframe in the browser console
{
action:"Start",
agent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36",
content_id:171,
group:1,
name:"1-1-API-SyLxpeJ_9@@-ZMDAO31505421137_1080P",
player:"644MGW1517420998",
publisher:1,
referrer:"http://localhost:3002/"
}
Events
Start
When the player starts playing the content
FirstQuartile
25% viewed
Midpoint
50% viewed
ThirdQuartile
75% viewed
Complete
100% viewed
Pause
When the player is paused
Resume
When a paused video is played again
Ended
When video playback ends
No Comments