soundcloud-iframe-analytics
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,2 +0,2 @@ | ||
!function(e){var n={};function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=1)}([function(e,n,t){n.loadScript=t(3),n.loadScriptPromised=t(2)},function(e,n,t){"use strict";t.r(n);var o=t(0);const r=!1;let i,a=!0;function c(e,n,t,o){if(!a)return;const c=function(){if(i)return i;"function"==typeof window.gtag?i=u.GlobalSiteTag:"function"==typeof window.ga?i=u.GA:"_gaq"in window&&"function"==typeof window._gaq.push&&(i=u.Legacy);return i||(a=!1,null)}();c&&(r&&console.info(`Tracking Event: category "${e}" action "${n}" label "${t}" value "${o}"`),c.event(e,n,t,o))}const u={GlobalSiteTag:{event(e,n,t,o){window.gtag("event",n,{event_category:e,event_label:t,value:o})}},GA:{event(e,n,t,o){window.ga("send","event",e,n,t)}},Legacy:{event(e,n,t,o){window._gaq.push(["_trackEvent",e,n,t])}}},d="https://w.soundcloud.com/player/api.js",s="soundcloud.com",l="SoundCloud";function f(e,n){return e.hasOwnProperty(n)||(e[n]={id:n,started:!1,paused:!1,finished:!1}),e[n]}function p(e,n){for(let t=0,o=e.length;t<o;++t)n(e[t])}window.onload=function(){const e=[];p(document.getElementsByTagName("iframe"),n=>{n.hasAttribute("src")&&n.getAttribute("src").indexOf(s)>-1&&e.push(n)}),0!==e.length&&o.loadScript(d,()=>{"SC"in window&&p(e,e=>{!function(e){const n=SC.Widget.Events;let t,o=!1,r="",i={};e.bind(n.PLAY_PROGRESS,()=>{o||(o=!0,setTimeout(()=>{o=!1,e.getCurrentSound(e=>{r!==e.title&&(r=e.title,i={})})},0===r.length?0:2500))}),e.bind(n.PLAY,()=>{e.getCurrentSound(e=>{r=e.title,!(t=f(i,e.title)).started||t.finished?(t.started=!0,t.finished=!1,t.paused=!1,c(l,"Playback started",r)):t.paused&&(t.paused=!1,c(l,"Playback resumed",r))})}),e.bind(n.PAUSE,()=>{t=f(i,r),e.getCurrentSound(e=>{e.title!==t.id||t.finished||(t.paused=!0,c(l,"Playback paused",r))})}),e.bind(n.SEEK,()=>{(t=f(i,r)).paused||t.finished||c(l,"Playback scrubbed",r)}),e.bind(n.FINISH,()=>{(t=f(i,r)).finished||(t.finished=!0,c(l,"Played in full",r))})}(SC.Widget(e))})})}},function(e,n){e.exports=function(e,n){var t,o,r=document;return new Promise(function(i,a){o=r.createElement("script"),t=r.getElementsByTagName("script")[0],n&&Object.keys(n).forEach(function(e){o[e]=n[e]}),o.async=1,o.src=e,o.onload=function(){i()},o.onerror=function(){a(new Error("failed to load: "+e))},t.parentNode.insertBefore(o,t)})}},function(e,n){e.exports=function(e,n,t){var o,r,i=document;r=i.createElement("script"),o=i.getElementsByTagName("script")[0],t&&Object.keys(t).forEach(function(e){r[e]=t[e]}),r.async=1,r.src=e,r.onload=function(){n()},r.onerror=function(){n(new Error("failed to load: "+e))},o.parentNode.insertBefore(r,o)}}]); | ||
!function(n){var e={};function t(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return n[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}t.m=n,t.c=e,t.d=function(n,e,o){t.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:o})},t.r=function(n){Object.defineProperty(n,"__esModule",{value:!0})},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s=1)}([function(n,e,t){e.loadScript=t(3),e.loadScriptPromised=t(2)},function(n,e,t){"use strict";t.r(e);var o=t(0),i=!1,r=!0,u=void 0;function c(n,e,t,o){if(r){var c=function(){if(u)return u;"function"==typeof window.gtag?u=a.GlobalSiteTag:"function"==typeof window.ga?u=a.GA:"_gaq"in window&&"function"==typeof window._gaq.push&&(u=a.Legacy);return u||(r=!1,null)}();c&&(i&&console.info('Tracking Event: category "'+n+'" action "'+e+'" label "'+t+'" value "'+o+'"'),c.event(n,e,t,o))}}var a={GlobalSiteTag:{event:function(n,e,t,o){window.gtag("event",e,{event_category:n,event_label:t,value:o})}},GA:{event:function(n,e,t,o){window.ga("send","event",n,e,t)}},Legacy:{event:function(n,e,t,o){window._gaq.push(["_trackEvent",n,e,t])}}},d="https://w.soundcloud.com/player/api.js",f="soundcloud.com",s="SoundCloud";function l(n,e){return n.hasOwnProperty(e)||(n[e]={id:e,started:!1,paused:!1,finished:!1}),n[e]}function p(n,e){for(var t=0,o=n.length;t<o;++t)e(n[t])}window.onload=function(){var n=[];p(document.getElementsByTagName("iframe"),function(e){e.hasAttribute("src")&&e.getAttribute("src").indexOf(f)>-1&&n.push(e)}),0!==n.length&&o.loadScript(d,function(){"SC"in window&&p(n,function(n){!function(n){var e=SC.Widget.Events,t=!1,o="",i={},r=void 0;n.bind(e.PLAY_PROGRESS,function(){t||(t=!0,setTimeout(function(){t=!1,n.getCurrentSound(function(n){o!==n.title&&(o=n.title,i={})})},0===o.length?0:2500))}),n.bind(e.PLAY,function(){n.getCurrentSound(function(n){o=n.title,!(r=l(i,n.title)).started||r.finished?(r.started=!0,r.finished=!1,r.paused=!1,c(s,"Playback started",o)):r.paused&&(r.paused=!1,c(s,"Playback resumed",o))})}),n.bind(e.PAUSE,function(){r=l(i,o),n.getCurrentSound(function(n){n.title!==r.id||r.finished||(r.paused=!0,c(s,"Playback paused",o))})}),n.bind(e.SEEK,function(){(r=l(i,o)).paused||r.finished||c(s,"Playback scrubbed",o)}),n.bind(e.FINISH,function(){(r=l(i,o)).finished||(r.finished=!0,c(s,"Played in full",o))})}(SC.Widget(n))})})}},function(n,e){n.exports=function(n,e){var t,o,i=document;return new Promise(function(r,u){o=i.createElement("script"),t=i.getElementsByTagName("script")[0],e&&Object.keys(e).forEach(function(n){o[n]=e[n]}),o.async=1,o.src=n,o.onload=function(){r()},o.onerror=function(){u(new Error("failed to load: "+n))},t.parentNode.insertBefore(o,t)})}},function(n,e){n.exports=function(n,e,t){var o,i,r=document;i=r.createElement("script"),o=r.getElementsByTagName("script")[0],t&&Object.keys(t).forEach(function(n){i[n]=t[n]}),i.async=1,i.src=n,i.onload=function(){e()},i.onerror=function(){e(new Error("failed to load: "+n))},o.parentNode.insertBefore(i,o)}}]); | ||
//# sourceMappingURL=sia.min.js.map |
{ | ||
"name": "soundcloud-iframe-analytics", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Automated Google Analytics tracking of user interaction on embedded SoundCloud iframes", | ||
"author": "Igor Zinken", | ||
"license": "MIT", | ||
"keywords": "soundcloud, widget, playlist, analytics, gtag, ga, behaviour, tracking", | ||
"scripts": { | ||
@@ -17,6 +18,4 @@ "dev": "cross-env NODE_ENV=dev webpack-dev-server --progress --mode development --config webpack.config.dev.js", | ||
}, | ||
"dependencies": { | ||
"ejs-compiled-loader": "1.1.0" | ||
}, | ||
"devDependencies": { | ||
"ejs-compiled-loader": "1.1.0", | ||
"babel-core": "6.26.0", | ||
@@ -23,0 +22,0 @@ "babel-loader": "7.1.4", |
@@ -51,3 +51,2 @@ import * as TinyScriptLoader from "tiny-script-loader"; | ||
let hasTimeout = false, currentId = "", tracks = {}, vo; | ||
@@ -54,0 +53,0 @@ // cache the id of the currently playing track as many events in the |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41867
0
20
400
22
- Removedejs-compiled-loader@1.1.0
- Removedejs-compiled-loader@1.1.0(transitive)
- Removeduglify-js@1.3.5(transitive)