2 lines
3.1 KiB
JavaScript
2 lines
3.1 KiB
JavaScript
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/libs/",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);const r=(window.JitsiMeetJS||(window.JitsiMeetJS={}),window.JitsiMeetJS.app||(window.JitsiMeetJS.app={}),window.JitsiMeetJS.app);r.analyticsHandlers=r.analyticsHandlers||[],r.analyticsHandlers.push(class extends class{constructor(e={}){this._enabled=!1,this._whiteListedEvents=e.whiteListedEvents,this._blackListedEvents=[...e.blackListedEvents||[],"e2e_rtt","rtp.stats","rtt.by.region","available.device","stream.switch.delay","ice.state.changed","ice.duration","peer.conn.status.duration"]}_extractName(e){if("page"===e.type)return e.name;const{action:t,actionSubject:n,source:r}=e;let i=t;return n&&n!==t&&(i=`${n}.${t}`),r&&r!==t&&(i=`${r}.${i}`),i}_shouldIgnore(e){if(!e||!this._enabled)return!0;const t=this._extractName(e);return Array.isArray(this._whiteListedEvents)?-1===this._whiteListedEvents.indexOf(t):!!Array.isArray(this._blackListedEvents)&&-1!==this._blackListedEvents.indexOf(t)}}{constructor(e){if(super(e),this._userProperties={},!e.googleAnalyticsTrackingId)throw new Error("Failed to initialize Google Analytics handler, no tracking ID");this._enabled=!0,this._initGoogleAnalytics(e)}_initGoogleAnalytics(e){var t,n,r,i,a,s;t=window,n=document,r="script",i="ga",t.GoogleAnalyticsObject=i,t.ga=t.ga||function(){(t.ga.q=t.ga.q||[]).push(arguments)},t.ga.l=1*new Date,a=n.createElement(r),s=n.getElementsByTagName(r)[0],a.async=1,a.src="//www.google-analytics.com/analytics.js",s.parentNode.insertBefore(a,s),ga("create",e.googleAnalyticsTrackingId,"auto"),ga("send","pageview")}_extractValue(e){let t=e&&e.attributes&&e.attributes.value;return t=Math.round(parseFloat(t)),t}_extractLabel(e){const{attributes:t={}}=e,n=Object.keys(t).map(e=>`${e}=${t[e]}`);return n.push(this._userPropertiesString),n.join("&")}setUserProperties(e={}){if(!this._enabled)return;const t=["user_agent","callstats_name"];this._userPropertiesString=Object.keys(e).filter(e=>-1===t.indexOf(e)).map(t=>`permanent_${t}=${e[t]}`).join("&")}sendEvent(e){if(this._shouldIgnore(e))return;const t={eventCategory:"jitsi-meet",eventAction:this._extractName(e),eventLabel:this._extractLabel(e)},n=this._extractValue(e);isNaN(n)||(t.eventValue=n),ga("send","event",t)}})}]);
|
|
//# sourceMappingURL=analytics-ga.min.map
|