1(function($) { 2$(document).ready(function () { 3 // Youtubeã®APIã©ã¤ãã©ãªãèªã¿è¾¼ã. 4 $.getScript('https://www.youtube.com/player_api', function () { 5 YT.ready(function () { 6 var getStateChangeEventName = function (event_id) { 7 if (event_id == YT.PlayerState.PLAYING) return 'åçåæ°'; 8 }; 9 10 $('iframe').filter(function(i, element){ 11 return element.src.indexOf('youtube.com/embed/') >= 0; 12 }).each(function(i, element) { 13 var player = new YT.Player(element); 14 player.addEventListener('onStateChange', function (e) { 15 var videoData = e.target['getVideoData'](); 16 var actionName = getStateChangeEventName(e["data"]); 17 var labelName = videoData.video_id + " : " + videoData.title; 18 ga('send', 'event', 'movie', actionName, labelName, { 19 'nonInteraction': true 20 }); 21// dataLayer.push({ 22// 'event': 'YoutubeEvent', 23// 'movie': { 24// 'action': actionName, 25// 'title': videoData.title, 26// 'video_id': videoData.video_id 27// } 28// }); 29 }); 30 }); 31 }); 32 }); 33}); 34})(jQuery);
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.