Sizmek video tracking help

sizmek

(Colin Taylor) #1

Hi there,

I moved to Hype when I found out about Adobe Edge being discontinued. I was wondering if those of you who have got ads through Sizmek could help me - I’m having tracking issues with a video in my ad. I have set scenes so that it plays Intro > Video (contains the tracked video) > Endframe. The ad resolves on the Endframe when the video has played through. I then have a replay button on the Endframe allowing the user to view the video again. When this replay button is clicked the video plays from the beginning and everything is all good. Except for the tracking, which tracks the video twice. Or three times. It will in fact track the video as many times as the user has clicked replay. I just want it to track once each time. Is anyone aware of this issue?

I’ve contacted Sizmek but they’re not being helpful, instead trying to push me towards the downright terrible new Animate CC (shudders).

Any help is greatly appreciated.


#2

I’m personally not familiar with how Sizmek handles video, but here’s a function that detects when a video has ended. It would need to match the ID of your Video element. In Hype, this would just need to run ‘on scene load’ where you have a video:

document.getElementById('sizmekvideo').addEventListener('timeupdate', function() {
var videoCurrentTime = document.getElementById('sizmekvideo').currentTime;
   // If the video is 15 seconds long, using 15 below would detect the end.
    if (videoCurrentTime >= 15) {
	// This function runs whenever the video is on or surpasses the 15 second mark
        // Google Analytics example:
        // ga('send', 'event', 'Videos', 'play', 'SizmekVideoEnded');
}

To have this function run only once, you would run it inside of a function like this:

var something = (function() {
        var executed = false;
        return function() {
            if (!executed) {
                executed = true;
                document.getElementById('sizmekvideo').addEventListener('timeupdate', function() {
                        var videoCurrentTime = document.getElementById('sizmekvideo').currentTime;

                        // If the video was 15 seconds long, using 15 below would detect the end.
                        if (videoCurrentTime >= 15) {

                            // This function runs whenever the video is on or surpasses the 15 second mark
                            // Google Analytics example:
                            // ga('send', 'event', 'Videos', 'play', 'SizmekVideoEnded');
                        }
                    }
                };
            })();