如何获得“秒播放”和“播放百分比”来自GA中JW Player 6的事件 [英] How to get "Seconds Played" and "Percentage Played" events from JW Player 6 in GA

查看:87
本文介绍了如何获得“秒播放”和“播放百分比”来自GA中JW Player 6的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到新的JW Player 6 Enterprise失去了报告已播放秒数和Google Analytics活动百分比的能力。



有没有人开发出一种方法来生产某些东西喜欢这个?我想JW Player API和一些JavaScript可以支持这些事件。


$ b [我们很好地利用了JW Player 5中的Seconds Played和Percentage Played功能,很伤心看到它。如果有任何来自JWPlayer的人在倾听:这些事件会回来!)

解决方案

我想你可以重新创建秒用onTime回调自己跟踪自己。试试这个:
$ b

  var currentDuration = -1; 
var currentPosition = -1;
var jw = jwplayer();
jw.onTime(function(){
var position = this.getPosition();
var duration = this.getDuration();
if((duration === currentDuration && position === currentPostion)|| duration === -1){
return;
}
currentPosition = position;
currentDuration = duration;
var file = this.getPlaylistItem()。file
return _gaq.push(['_ trackEvent','JW Player Seconds Played',file,window.location.href);
});




I see the new JW Player 6 Enterprise has lost the capability to report Seconds Played and Percentage Played as Google Analytics Events.

Has anyone developed a method to produce something like this? I imagine the JW Player API and some JavaScript could support these events.

[We made great use of the Seconds Played and Percentage Played capabilities in JW Player 5, and I'm sad to see it go. If anyone from JWPlayer is listening: it would be great to have those events back!]

解决方案

I think you could recreate the seconds played tracking on your own with the onTime callback. Try this:

var currentDuration = -1;
var currentPosition = -1;
var jw = jwplayer();
jw.onTime(function() {
    var position = this.getPosition();
    var duration = this.getDuration();
    if ((duration === currentDuration && position === currentPostion) || duration === -1 ) {
      return;
    }
    currentPosition = position;
    currentDuration = duration;
    var file = this.getPlaylistItem().file
    return _gaq.push(['_trackEvent', 'JW Player Seconds Played', file, window.location.href);
});

这篇关于如何获得“秒播放”和“播放百分比”来自GA中JW Player 6的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆