google-analytics - JWPlayer 6 的 Google Analytics 视频跟踪问题

标签 google-analytics jwplayer issue-tracking

我对这一切都很陌生,只是不知道如何跟踪可以在我的网站上播放的视频。 我刚刚将 GA 代码安装到我的页面,因此我假设我正在使用新的异步跟踪。问题是我无法在 GA 面板中跟踪此视频。 谢谢

我的代码如下所示。

   <script type='text/javascript' src='js/jwplayer.js'></script>
    <script type='text/javascript' src='js/jwplayer.html5.js'></script>   

   (function (i, s, o, g, r, a, m) {
       i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
           (i[r].q = i[r].q || []).push(arguments)
       }, i[r].l = 1 * new Date(); a = s.createElement(o),
  m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
   })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
   ga('create', 'UA-40700489-1', 'epcint.com');
   ga('send', 'pageview');


 <script type="text/javascript">jwplayer.key = "myplayerkey=";</script> 
<script type="text/javascript">
    $(document).ready(function () {
        jwplayer('mediaplayer').setup({
            file: 'video.mp4',
            width: "100%",
            height: "480",
            autostart: true,
            ga: {


            }
        });
    });
</script>

<div id="mediaplayer">
 </div>

任何帮助将不胜感激 谢谢

Thanks for your feedback i have updated and Debug the code in GA debugger i got the error whats this means ?

Initializing Google Analytics. analytics_debug.js:9 Registered new plugin: ga(provide, "linker", Function) analytics_debug.js:9 Registered new plugin: ga(provide, "displayfeatures", Function) analytics_debug.js:9 Running command: ga(create, UA-40700489-2, infopav.com) analytics_debug.js:9 Creating new tracker: t0 analytics_debug.js:9 Running command: ga(send, pageview) analytics_debug.js:9

Sent beacon: v=1&_v=j16d&a=686083534&t=pageview&_s=1&dl=http%3A%2F%2Fdev.www.infopave.com%2FPage%2FIndex%2FHOW_TO_ACCESS_LTPP_DATA&ul=en-us&de=UTF-8…30201944&_u=MCCC~&cid=2101349279.1393503811&tid=UA-40700489-2&z=1727898794

analytics_debug.js:9 adSenseId (&a) 686083534 analytics_debug.js:9 apiVersion (&v) 1analytics_debug.js:9 clientId (&cid) 2101349279.1393503811analytics_debug.js:9 编码 (&de) UTF-8 Analytics_debug.js:9 flashVersion
(&fl) 12.0 r0 Analytics_debug.js:9 hitType (&t) 综合浏览量 analytics_debug.js:9 javaEnabled (&je) 1analytics_debug.js:9 语言 (&ul) en-us Analytics_debug.js:9 位置
(&dl)http://dev.www.infopave.com/Page/Index/HOW_TO_ACCESS_LTPP_DATA Analytics_debug.js:9 屏幕颜色 (&sd) 24 位 Analytics_debug.js:9 屏幕分辨率 (&sr) 1680x1050 Analytics_debug.js:9 标题 (&dt) LTPP InfoPave - 如何 访问 LTPP 数据? Analytics_debug.js:9trackingId (&tid) UA-40700489-2 Analytics_debug.js:9 viewportSize (&vp) 1665x429 Analytics_debug.js:9

There was an error while handling a listener: TypeError: Cannot read property 'id' of null function

(){if("array"==a.typeOf(m.playlist)&&2>m.playlist.length&&(0==m.playlist.length|| !m.playlist[0].sources||0==m.playlist[0].sources.length))g();else if(s.getStatus()==a.loaderstatus.COMPLETE){for(var e=0;em.modes[e].type;if(r.supportsConfig())return r.addEventListener(l.ERROR,d),r.embed(),c(b,f.events),b}m.fallback?(a.log("否 找到合适的玩家并启用后备”),新 j.download(n,m,g)):(a.log("没有找到合适的玩家并回退 禁用"),n.parentNode.replaceChild(h, n))}} jwplayer.js:3

event.returnValue 已弃用。请使用标准 改为 event.preventDefault() 。 jquery-1.8.2.min.js:2 9 无法添加 内部监听器 jwplayer.js:3 回调时发生错误 事件处理程序

更新代码

 $(document).ready(function () {

        jwplayer("mediaplayer").setup({
            file: 'rtmp://s1nu7pjztotbeg.cloudfront.net/cfx/st/mp4:Help/How_To/GettingStarted_V2-Sm_x264.mp4',
            width: "100%",
            height: "480",
            autostart: true,
            events: {
                onComplete: function (evt) {

                },

                onReady: function (event) {

                    ga('send', 'event', 'Video Played', 'action', { 'page': 'http://dev.www.infopave.com/Page/Index/HOW_TO_ACCESS_LTPP_DATA' });

                },
                onPlay: function (evt) {

                },
                onVolume: function (evt) {
                    alert("the new volume is: " + evt.volume);
                }


            },


            ga: {

            }


        });

    });

i want to send this when some one click the play button ,i want to send this code only

               ga('send', 'event', 'Video Played', 'action', { 'page': 'http://dev.www.infopave.com/Page/Index/HOW_TO_ACCESS_LTPP_DATA' });

我如何在 jquery 中单击该按钮,谢谢您的帮助...

Thanks any help will be highly appriciated

最佳答案

我建议您查看Event-tracking 。您可以在 onclick 中添加一个标签,以便当用户点击观看您的视频时,您将记录一个事件,您可以在 Google Analytics 的Behavior -> events

下找到该事件

我还没有测试过这个,但你应该能够执行以下操作:

<div id="mediaplayer" onclick="ga('send', 'event', 'video', 'click', 'videoname');">
</div>

注意:事件将在 24 小时后首先显示在标准报告中。您还可以在实时报告中看到它们。

关于google-analytics - JWPlayer 6 的 Google Analytics 视频跟踪问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22088769/

相关文章:

sql - 如何在谷歌大查询中选择谷歌分析段? SQL

google-analytics - Google Analytics(分析): Site Speed average always at 0. 00

javascript - 是否可以使用 JavaScript API 将视频持续时间添加到 JWPlayer?

github - 如何从 GitHub 上彻底删除问题?

open-source - 哪个开源、可扩展、可能易于使用的问题跟踪器? redmine、trac、bugzilla、螳螂、RT?

JIRA:jira 问题可以从完成中移出吗?

google-analytics - Google Analytics - 收集限制和抽样

html - Flash 和 "206 partial conent"http 状态码

javascript - JW Player smarty 不工作

angularjs - Angular 应用程序中 Google Analytics 的 Jasmine 测试出错