forked from snowplow/snowplow-javascript-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtracking.html
More file actions
50 lines (47 loc) · 1.68 KB
/
Copy pathtracking.html
File metadata and controls
50 lines (47 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<head>
<title>Page for HTML5 media tracking testing with Snowplow Micro</title>
<script>
var collector_endpoint = document.cookie.split('container=')[1].split(';')[0].trim();
var testIdentifier = document.cookie.split('testIdentifier=')[1].split(';')[0].trim();
document.body.className += ' loaded';
</script>
</head>
<body>
<script>
(function (p, l, o, w, i, n, g) {
if (!p[i]) {
p.GlobalSnowplowNamespace = p.GlobalSnowplowNamespace || [];
p.GlobalSnowplowNamespace.push(i);
p[i] = function () {
(p[i].q = p[i].q || []).push(arguments);
};
p[i].q = p[i].q || [];
n = l.createElement(o);
g = l.getElementsByTagName(o)[0];
n.async = 1;
n.src = w;
g.parentNode.insertBefore(n, g);
}
})(window, document, 'script', '../snowplow.js', 'snowplow');
document.write(collector_endpoint);
window.snowplow('newTracker', 'sp2', collector_endpoint, {
appId: 'media-default-events-' + testIdentifier,
});
window.snowplow('startHtml5MediaTracking', {
id: testIdentifier,
video: 'html5',
boundaries: [95],
label: 'test-label',
});
</script>
<!--
The element must be muted to avoid:
javascript error: javascript error: play() failed because the user didn't interact with the document first. https://goo.gl/xX8pDD
-->
<video id="html5" src="./test-video.mp4" height="250px" width="250px" controls muted>
<track kind="captions" label="English" src="./test-track.vtt" srclang="en" default />
</video>
</body>
</html>