diff --git a/dist/angulartics-google-analytics.min.js b/dist/angulartics-google-analytics.min.js index edf912c..ae17bbe 100644 --- a/dist/angulartics-google-analytics.min.js +++ b/dist/angulartics-google-analytics.min.js @@ -1,2 +1,2 @@ -!function(window,angular,undefined){"use strict";angular.module("angulartics.google.analytics",["angulartics"]).config(["$analyticsProvider",function($analyticsProvider){function setDimensionsAndMetrics(properties){if(window.ga)for(var idx=1;200>=idx;idx++)properties["dimension"+idx.toString()]&&ga("set","dimension"+idx.toString(),properties["dimension"+idx.toString()]),properties["metric"+idx.toString()]&&ga("set","metric"+idx.toString(),properties["metric"+idx.toString()])}$analyticsProvider.settings.pageTracking.trackRelativePath=!0,$analyticsProvider.settings.ga={additionalAccountNames:undefined,userId:null},$analyticsProvider.registerPageTrack(function(path){window._gaq&&(_gaq.push(["_trackPageview",path]),angular.forEach($analyticsProvider.settings.ga.additionalAccountNames,function(accountName){_gaq.push([accountName+"._trackPageview",path])})),window.ga&&($analyticsProvider.settings.ga.userId&&ga("set","&uid",$analyticsProvider.settings.ga.userId),ga("send","pageview",path),angular.forEach($analyticsProvider.settings.ga.additionalAccountNames,function(accountName){ga(accountName+".send","pageview",path)}))}),$analyticsProvider.registerEventTrack(function(action,properties){if(properties&&properties.category||(properties=properties||{},properties.category="Event"),properties.value){var parsed=parseInt(properties.value,10);properties.value=isNaN(parsed)?0:parsed}if(window.ga){var eventOptions={eventCategory:properties.category,eventAction:action,eventLabel:properties.label,eventValue:properties.value,nonInteraction:properties.noninteraction,page:properties.page||window.location.hash.substring(1)||window.location.pathname,userId:$analyticsProvider.settings.ga.userId};setDimensionsAndMetrics(properties),ga("send","event",eventOptions),angular.forEach($analyticsProvider.settings.ga.additionalAccountNames,function(accountName){ga(accountName+".send","event",eventOptions)})}else window._gaq&&_gaq.push(["_trackEvent",properties.category,action,properties.label,properties.value,properties.noninteraction])}),$analyticsProvider.registerSetUsername(function(userId){$analyticsProvider.settings.ga.userId=userId}),$analyticsProvider.registerSetUserProperties(function(properties){setDimensionsAndMetrics(properties)})}])}(window,window.angular); +!function(window,angular,undefined){"use strict";angular.module("angulartics.google.analytics",["angulartics"]).config(["$analyticsProvider",function($analyticsProvider){function setDimensionsAndMetrics(properties){if(window.ga)for(var idx=1;200>=idx;idx++)properties["dimension"+idx.toString()]&&ga("set","dimension"+idx.toString(),properties["dimension"+idx.toString()]),properties["metric"+idx.toString()]&&ga("set","metric"+idx.toString(),properties["metric"+idx.toString()])}$analyticsProvider.settings.pageTracking.trackRelativePath=!0,$analyticsProvider.settings.ga={additionalAccountNames:undefined,userId:null},$analyticsProvider.registerPageTrack(function(path){window._gaq&&(_gaq.push(["_trackPageview",path]),angular.forEach($analyticsProvider.settings.ga.additionalAccountNames,function(accountName){_gaq.push([accountName+"._trackPageview",path])})),window.ga&&($analyticsProvider.settings.ga.userId&&ga("set","&uid",$analyticsProvider.settings.ga.userId),ga("send","pageview",path),angular.forEach($analyticsProvider.settings.ga.additionalAccountNames,function(accountName){ga(accountName+".send","pageview",path)}))}),$analyticsProvider.registerEventTrack(function(action,properties){if(properties&&properties.category||(properties=properties||{},properties.category="Event"),properties.value){var parsed=parseInt(properties.value,10);properties.value=isNaN(parsed)?0:parsed}if(window.ga){var eventOptions={eventCategory:properties.category,eventAction:action,eventLabel:properties.label,eventValue:properties.value,nonInteraction:properties.noninteraction,page:properties.page||window.location.hash.substring(1)||window.location.pathname,userId:$analyticsProvider.settings.ga.userId};setDimensionsAndMetrics(properties),$analyticsProvider.settings.ga.transport?ga("send","event",eventOptions,{transport:$analyticsProvider.settings.ga.transport}):ga("send","event",eventOptions),angular.forEach($analyticsProvider.settings.ga.additionalAccountNames,function(accountName){ga(accountName+".send","event",eventOptions)})}else window._gaq&&_gaq.push(["_trackEvent",properties.category,action,properties.label,properties.value,properties.noninteraction])}),$analyticsProvider.registerExceptionTrack(function(properties){return properties&&properties.appId&&properties.appName&&properties.appVersion?(properties.fatal===undefined&&(console.log('No "fatal" provided, sending with fatal=true'),properties.exFatal=!0),properties.exDescription=properties.description,void ga("send","exception",properties)):void console.error("Must be setted appId, appName and appVersion.")}),$analyticsProvider.registerSetUsername(function(userId){$analyticsProvider.settings.ga.userId=userId}),$analyticsProvider.registerSetUserProperties(function(properties){setDimensionsAndMetrics(properties)}),$analyticsProvider.registerUserTimings(function(properties){return properties&&properties.timingCategory&&properties.timingVar&&properties.timingValue?void(window.ga&&ga("send","timing",properties)):void console.error("Properties timingCategory, timingVar, and timingValue are required to be set.")})}])}(window,window.angular); //# sourceMappingURL=../dist/angulartics-google-analytics.min.js.map \ No newline at end of file diff --git a/dist/angulartics-google-analytics.min.js.map b/dist/angulartics-google-analytics.min.js.map index 862aa65..4a627e2 100644 --- a/dist/angulartics-google-analytics.min.js.map +++ b/dist/angulartics-google-analytics.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["lib/angulartics-google-analytics.js"],"names":["window","angular","undefined","module","config","$analyticsProvider","setDimensionsAndMetrics","properties","ga","idx","toString","settings","pageTracking","trackRelativePath","additionalAccountNames","userId","registerPageTrack","path","_gaq","push","forEach","accountName","registerEventTrack","action","category","value","parsed","parseInt","isNaN","eventOptions","eventCategory","eventAction","eventLabel","label","eventValue","nonInteraction","noninteraction","page","location","hash","substring","pathname","registerSetUsername","registerSetUserProperties"],"mappings":"CAAA,SAAUA,OAAQC,QAASC,WAAY,YAOvCD,SAAQE,OAAO,gCAAiC,gBAC/CC,QAAQ,qBAAsB,SAAUC,oBAcvC,QAASC,yBAAwBC,YAC/B,GAAIP,OAAOQ,GAET,IAAI,GAAIC,KAAM,EAAQ,KAALA,IAASA,MACpBF,WAAW,YAAaE,IAAIC,aAC9BF,GAAG,MAAO,YAAaC,IAAIC,WAAYH,WAAW,YAAaE,IAAIC,aAEjEH,WAAW,SAAUE,IAAIC,aAC3BF,GAAG,MAAO,SAAUC,IAAIC,WAAYH,WAAW,SAAUE,IAAIC,aAjBrEL,mBAAmBM,SAASC,aAAaC,mBAAoB,EAG7DR,mBAAmBM,SAASH,IAE1BM,uB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,mBAAmBM,SAASH,GAAGO,OAASA,SAG1CV,mBAAmBsC,0BAA0B,SAAUpC,YAErDD,wBAAwBC,kBAIzBP,OAAQA,OAAOC","file":"dist/angulartics-google-analytics.min.js","sourceRoot":".."} \ No newline at end of file +{"version":3,"sources":["lib/angulartics-google-analytics.js"],"names":["window","angular","undefined","module","config","$analyticsProvider","setDimensionsAndMetrics","properties","ga","idx","toString","settings","pageTracking","trackRelativePath","additionalAccountNames","userId","registerPageTrack","path","_gaq","push","forEach","accountName","registerEventTrack","action","category","value","parsed","parseInt","isNaN","eventOptions","eventCategory","eventAction","eventLabel","label","eventValue","nonInteraction","noninteraction","page","location","hash","substring","pathname","transport","registerExceptionTrack","appId","appName","appVersion","fatal","console","log","exFatal","exDescription","description","error","registerSetUsername","registerSetUserProperties","registerUserTimings","timingCategory","timingVar","timingValue"],"mappings":"CAAA,SAAUA,OAAQC,QAASC,WAAY,YAOvCD,SAAQE,OAAO,gCAAiC,gBAC/CC,QAAQ,qBAAsB,SAAUC,oBAcvC,QAASC,yBAAwBC,YAC/B,GAAIP,OAAOQ,GAET,IAAI,GAAIC,KAAM,EAAQ,KAALA,IAASA,MACpBF,WAAW,YAAaE,IAAIC,aAC9BF,GAAG,MAAO,YAAaC,IAAIC,WAAYH,WAAW,YAAaE,IAAIC,aAEjEH,WAAW,SAAUE,IAAIC,aAC3BF,GAAG,MAAO,SAAUC,IAAIC,WAAYH,WAAW,SAAUE,IAAIC,aAjBrEL,mBAAmBM,SAASC,aAAaC,mBAAoB,EAG7DR,mBAAmBM,SAASH,IAE1BM,uBAAwBZ,UACxBa,OAAQ,MAiBVV,mBAAmBW,kBAAkB,SAAUC,MACzCjB,OAAOkB,OACTA,KAAKC,MAAM,iBAAkBF,OAC7BhB,QAAQmB,QAAQf,mBAAmBM,SAASH,GAAGM,uBAAwB,SAAUO,aAC/EH,KAAKC,MAAME,YAAc,kBAAmBJ,UAG5CjB,OAAOQ,KACLH,mBAAmBM,SAASH,GAAGO,QACjC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B5C,WAAW6C,gBAEtC5C,IAAG,OAAQ,YAAaD,iBAXpByC,SAAQK,MAAM,mDAcpBhD,mBAAmBiD,oBAAoB,SAAUvC,QAC/CV,mBAAmBM,SAASH,GAAGO,OAASA,SAG1CV,mBAAmBkD,0BAA0B,SAAUhD,YAErDD,wBAAwBC,cAgB1BF,mBAAmBmD,oBAAoB,SAAUjD,YAC/C,MAAKA,aAAeA,WAAWkD,gBAAmBlD,WAAWmD,WAAcnD,WAAWoD,iBAKnF3D,OAAOQ,IACRA,GAAG,OAAQ,SAAUD,iBALrByC,SAAQK,MAAM,uFAUjBrD,OAAQA,OAAOC","file":"dist/angulartics-google-analytics.min.js","sourceRoot":".."} \ No newline at end of file diff --git a/package.json b/package.json index 4edd166..792a156 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angulartics-google-analytics", - "version": "0.1.3", + "version": "0.1.4", "description": "Google Analytics plugin for Angulartics", "keywords": [ "google",