Analytics for videojs

This commit is contained in:
2017-02-08 16:27:52 +01:00
parent 02f736dcc4
commit 0a86ad357f
3 changed files with 18 additions and 1 deletions

View File

@@ -132,7 +132,17 @@
script(type="text/javascript").
{% if node.video_sources %}
videojs(document.getElementById('videoplayer'), { fluid: true });
videojs(document.getElementById('videoplayer'), {
fluid: true
},
function(){
this.ga({
'eventLabel' : '{{ node._id }} - {{ node.name }}',
'eventCategory' : '{{ node.project }}',
'eventsToTrack' : ['start', 'error', 'percentsPlayed']
});
}
);
{% endif %}
$(function(){

View File

@@ -72,6 +72,7 @@ link(rel="amphtml", href="{{ url_for('nodes.view', node_id=node._id, _external=T
| {% endif %}
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/videojs-5.8.8.min.js', v=6220171) }}")
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/videojs-ga-0.4.2.min.js', v=6220171) }}")
| {% endblock %}
| {% block css %}