Track custom video events from ooyala player version 3 in omniture

amitj723

08-09-2016

As part of a test implementation I have to track the videos played through omniture milestone tracking. The player is ooyala version 3. I am able to get the code where alert is print once the video is played for 25%, 50%, 75% and 100% of the total video length. Question is how can i bind these with events in omniture. I did some implementation but i guess, the reports are coming blank for these custom events. The logic is once the video reaches 25% mark, event1 should be fired, if 50% mark, event2 should be fired and so on. and these custom events in omniture should return the counts so that i will know how many times these events have been fired... Any help please.

My test code -

<script> var s=s_gi("Report Suite ID") var mplayer, mesb, dur, title, events, event7, event8, event9, event10; OO.ready(function() { var lastTriggerPos; mplayer = OO.Player.create('ooyalaplayer','player ID'); mplayer.mb.subscribe(OO.EVENTS.PLAYBACK_READY, 'example', function(eventName) { title = mplayer.getCurrentItemTitle(); var vData = mplayer.getItem(); dur = parseInt(vData.time); }); mplayer.mb.subscribe(OO.EVENTS.PLAYHEAD_TIME_CHANGED, 'example', function(eventName) { phPos = parseInt(mplayer.getPlayheadTime()); if ((phPos == parseInt(dur * 0.25)) && phPos != lastTriggerPos) { lastTriggerPos = phPos; s.events=event7 } else if ((phPos == parseInt(dur * 0.50)) && phPos != lastTriggerPos) { lastTriggerPos = phPos; s.events=event8; } else if ((phPos == parseInt(dur * 0.75)) && phPos != lastTriggerPos) { lastTriggerPos = phPos; s.events=event9; } else if ((phPos == parseInt(dur * 1)) && phPos != lastTriggerPos) { lastTriggerPos = phPos; s.events=event10; } var s_code=s.t();if(s_code)document.write(s_code) });}); </script>

Accepted Solutions (1)

Accepted Solutions (1)

Gigazelle

Employee

14-09-2016

Hi Amit, welcome to the Adobe Analytics community!

Given this is JavaScript, are you able to execute and run this code in a browser? If so, are you getting any JavaScript errors? If not, I would recommend looking in Chrome's developer tools to see if image requests are triggering properly. If you have a test page with code implemented, we would be happy to take a look and see if there's any issues with the code.

Edit: Found your same question on StackOverflow, and it looks like CrayonViolent noticed that the event values were not in quotes.

Answers (0)