1function trackEvent(event, data = {}) { 2 if (typeof sendGtmEvent === 'function') { 3 sendGtmEvent('tn.' + event, data); 4 } 5 6 fetch('/events', { 7 method: 'POST', 8 headers: { 9 'Content-Type': 'application/json' 10 }, 11 body: JSON.stringify({ event: event, data: data }) 12 }).catch(() => {}); 13} 14 15window.trackEvent = trackEvent; 16 17function initTrackEventListeners() { 18 document.body.addEventListener('vidstore-video-play', function (e) { 19 trackEvent('video_play', { video_id: e.detail.video_id }); 20 }); 21 22 document.body.addEventListener('vidstore-video-completed', function (e) { 23 trackEvent('video_complete', { video_id: e.detail.video_id }); 24 }); 25 26 document.body.addEventListener('vidstore-class-session-play', function (e) { 27 trackEvent('class_session_play', { class_session_id: e.detail.class_session_id }); 28 }); 29 30 document.body.addEventListener('vidstore-class-session-completed', function (e) { 31 trackEvent('class_session_complete', { class_session_id: e.detail.class_session_id }); 32 }); 33} 34 35if (document.readyState === 'loading') { 36 document.addEventListener('DOMContentLoaded', initTrackEventListeners); 37} else { 38 initTrackEventListeners(); 39}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.