如何通过android中的omniture跟踪视频跟踪

时间:2013-06-07 16:12:12

标签: android adobe-analytics

在我的应用程序中,我正在实施视频跟踪。我使用了以下代码

public static void Videotracking (String AppState,String Mappingevent1,String Mappingevent2,String Mappingevent3)

{   

ADMS_MediaMeasurement mediaMeasure = ADMS_MediaMeasurement.sharedInstance();
Hashtable<String, Object> milestoneMapping = new Hashtable<String, Object>();
milestoneMapping.put(Mappingevent1, "event9");
milestoneMapping.put(Mappingevent2, "event10");
milestoneMapping.put(Mappingevent3, "event11");

Hashtable<String, Object> contextDataMapping= new Hashtable<String, Object>();
contextDataMapping.put("a.media.milestones", milestoneMapping);
contextDataMapping.put("a.media.name", "eVar29,prop29");
contextDataMapping.put("a.media.segment", "eVar55");
contextDataMapping.put("a.contentType", "eVar5"); //note that this is not in the .media namespace
contextDataMapping.put("a.media.timePlayed", "event26");
contextDataMapping.put("a.media.view", "event8");
contextDataMapping.put("a.media.segmentView", "event25");
contextDataMapping.put("a.media.complete", "event12");
mediaMeasure.contextDataMapping =contextDataMapping;  
mediaMeasure.trackVars="evar57,evar58,evar59";
mediaMeasure.trackMilestones=Mappingevent1+","+Mappingevent2+","+Mappingevent3;
}

但我无法在视频开头或完成时找到何时将这些数据发送到服务器,并且当我调用此方法时它会发送两个请求而不是一个请求;

如果有任何实施视频跟踪,请提供帮助。

1 个答案:

答案 0 :(得分:1)

本文档概述了在Android中跟踪视频的过程:http://microsite.omniture.com/t2/help/en_US/sc/appmeasurement/android/index.html#Video_Measurement_Quick_Start

看起来你有一半的代码可以配置跟踪,但却缺少实际的通话:

function startMovie(){  
    mediaMeasure.open(mediaName,mediaLength,mediaPlayerName);
    playMovie();    
}

function endMovie(){
    stopMovie();
    mediaMeasure.close(mediaName);
}