@aicore/core-analytics-client-lib 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/dist/analytics.min.js +3 -3
- package/dist/analytics.min.js.map +1 -1
- package/package.json +1 -1
- package/src/analytics.js +3 -2
package/README.md
CHANGED
|
@@ -39,6 +39,8 @@ in the `initAnalyticsSession` call below:
|
|
|
39
39
|
```
|
|
40
40
|
This will create a global `analytics` variable which can be used to access the analytics APIs.
|
|
41
41
|
|
|
42
|
+
NB: The script is loaded async, so it will not block other js scripts. `analytics.event` api can be called anytime
|
|
43
|
+
after the above code and need not wait for the script load to complete.
|
|
42
44
|
|
|
43
45
|
## Raising analytics events
|
|
44
46
|
We can now start logging analytics events by calling `analytics.event` API.
|
|
@@ -72,6 +74,37 @@ analytics.event("platform", "CPU", "coreCountsAndFrequencyMhz", 8, 2300);
|
|
|
72
74
|
|
|
73
75
|
|
|
74
76
|
## Advanced Usages
|
|
77
|
+
|
|
78
|
+
### Pure JS loading instead of HTML scripts
|
|
79
|
+
|
|
80
|
+
There may be cases where you would want to load the script from JS alone. For Eg. you
|
|
81
|
+
may want to delay library loading till user consents GDPR. For such use cases, use the below code.
|
|
82
|
+
|
|
83
|
+
```js
|
|
84
|
+
function _initCoreAnalytics() {
|
|
85
|
+
// Load core analytics scripts
|
|
86
|
+
if(!window.analytics){ window.analytics = {
|
|
87
|
+
_initData: [], loadStartTime: new Date().getTime(),
|
|
88
|
+
event: function (){window.analytics._initData.push(arguments);}
|
|
89
|
+
};}
|
|
90
|
+
let script = document.createElement('script');
|
|
91
|
+
script.type = 'text/javascript';
|
|
92
|
+
script.async = true;
|
|
93
|
+
script.onload = function(){
|
|
94
|
+
// replace `your_analytics_account_ID` and `appName` below with your values
|
|
95
|
+
window.initAnalyticsSession('your_analytics_account_ID', 'appName'); // if you have a custom analytics server
|
|
96
|
+
window.analytics.event("core-analytics", "client-lib", "loadTime", 1,
|
|
97
|
+
(new Date().getTime())- window.analytics.loadStartTime);
|
|
98
|
+
};
|
|
99
|
+
script.src = 'https://unpkg.com/@aicore/core-analytics-client-lib/dist/analytics.min.js';
|
|
100
|
+
document.getElementsByTagName('head')[0].appendChild(script);
|
|
101
|
+
}
|
|
102
|
+
_initCoreAnalytics();
|
|
103
|
+
```
|
|
104
|
+
To load the library, just call `_initCoreAnalytics()` from JS. Note that you may not be able
|
|
105
|
+
to use `analytics.event()` APIs before `_initCoreAnalytics()` call is made.
|
|
106
|
+
|
|
107
|
+
### initAnalyticsSession: modify when, where and how analytics lib sends events
|
|
75
108
|
If you want to modify how analytics library collects and sends information, it is recommended to do so
|
|
76
109
|
with analytics server [accountConfig](https://github.com/aicore/Core-Analytics-Server#accountconfig-configuration).
|
|
77
110
|
|
package/dist/analytics.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function initAnalyticsSession(e,t,n,a,o,i){let r,
|
|
2
|
-
typically means that you may be sending too many value events? .`),
|
|
3
|
-
postIntervalSeconds:${c}, granularitySec: ${f} ,URL: `+
|
|
1
|
+
function initAnalyticsSession(e,t,n,a,o,i){let s,r,l,u,c,f,y,v,d={};const m=30,p="aicore.analytics.userID",g="aicore.analytics.sessionID",h=1e4;let w=null;var C,b="undefined"==typeof window;let I="https://analytics.core.ai",S,D,E=0,T=!1,A=!1;function N(...e){A&&console.log(...e)}if(b)throw new Error("Node environment is not currently supported");function $(){return{schemaVersion:1,accountID:s,appName:r,uuid:l,sessionID:u,unixTimestampUTC:+new Date,numEventsTotal:0,events:{}}}function k(){if(!w)throw new Error("Please call initSession before using any analytics event")}function U(e){e.backoffCount=(e.backoffCount||0)+1,N(`Failed to call core analytics server. Will retry in ${m*e.backoffCount}s: `),setTimeout(()=>{R(e)},1e3*m*e.backoffCount)}function R(t){var e;T||(t||(t=w,E=0,_(),w=$()),0!==t.numEventsTotal&&((e=JSON.stringify(t)).length>h&&console.warn(`Analytics event generated is very large at greater than ${e.length}B. This
|
|
2
|
+
typically means that you may be sending too many value events? .`),N("Sending Analytics data of length: ",e.length,"B"),window.fetch(v,{method:"POST",headers:{"Content-Type":"application/json"},body:e}).then(e=>{200!==e.status&&(400!==e.status?U(t):console.error("Analytics client: Bad Request, this is most likely a problem with the library, update to latest version."))}).catch(e=>{e=[e],A&&console.error(...e),U(t)})))}function _(e){S&&(clearInterval(S),S=null),e||(S=setInterval(()=>{E+=f},1e3*f))}function B(e){_(e),D&&(clearInterval(D),D=null),e||(D=setInterval(R,1e3*c))}function O(n,a,o,i=1,s=0){if(!T){var r=n,l=a,u=o,c=i,f=s;if(k(),!r||!l||!u)throw new Error("missing eventType or category or subCategory");if("number"!=typeof c||c<0)throw new Error("invalid count, count should be a positive number");if("number"!=typeof f)throw new Error("invalid value, value should be a number");{r=n;l=a;u=o;let e=w.events;e[r]=e[r]||{},e[r][l]=e[r][l]||{},e[r][l][u]=e[r][l][u]||{time:[],valueCount:[]}}let t=w.events;c=t[n][a][o].time;if((0<c.length?c[c.length-1]:null)===E){f=t[n][a][o].valueCount.length-1;{var r=f,l=n,u=a,c=o,f=i,y=s;let t=w.events;var e="number"==typeof t[l][u][c].valueCount[r];if(e&&0===y)t[l][u][c].valueCount[r]+=f;else if(e&&0!==y){let e={};e[y]=f,e[0]=t[l][u][c].valueCount[r],t[l][u][c].valueCount[r]=e}else if(!e){let e=t[l][u][c].valueCount[r];e[y]=(e[y]||0)+f}w.numEventsTotal+=1}}else{if(t[n][a][o].time.push(E),0===s)t[n][a][o].valueCount.push(i);else{let e={};e[s]=i,t[n][a][o].valueCount.push(e)}w.numEventsTotal+=1}}}if(!e||!t)throw new Error("accountID and appName must exist for init");y=n?n.replace(/\/$/,""):I,s=e,r=t,A=i||!1,c=a||600,f=o||3,v=y+"/ingest",l=function(){let e=localStorage.getItem(p);return e||(e=crypto.randomUUID(),localStorage.setItem(p,e)),e}(),u=function(){let e=sessionStorage.getItem(g);return e||(e=Math.random().toString(36).substr(2,10),sessionStorage.setItem(g,e)),e}(),w=$(),B(),async function(e,t){(d=await new Promise((n,a)=>{var e=y+(`/getAppConfig?accountID=${s}&appName=`+r);window.fetch(e).then(async e=>{switch(e.status){case 200:var t=await e.json();return void n(t);case 400:a("Bad Request, check library version compatible?",e);break;default:a("analytics client: Could not update from remote config. Continuing with defaults.",e)}}).catch(e=>{a("analytics client: Could not update from remote config. Continuing with defaults.",e)})}))!=={}&&(c=e||d.postIntervalSecondsInit||600,f=t||d.granularitySecInit||3,y=d.analyticsURLInit||y||I,B(T=!0===d.disabled),N(`Init analytics Config from remote. disabled: ${T}
|
|
3
|
+
postIntervalSeconds:${c}, granularitySec: ${f} ,URL: `+y),T&&console.warn(`Core Analytics is disabled from the server for app: ${s}:`+r))}(a,o);for(C of analytics._initData)O(...C);analytics._initData=[],analytics._getCurrentAnalyticsEvent=function(){return k(),JSON.parse(JSON.stringify(w))},analytics._getAppConfig=function(){return{accountID:s,appName:r,disabled:T,uuid:l,sessionID:u,postIntervalSeconds:c,granularitySec:f,analyticsURL:y,serverConfig:d}},analytics.event=O}window.analytics||(window.analytics={_initData:[]});
|
|
4
4
|
//# sourceMappingURL=analytics.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"src/analytics.js","sources":["src/analytics.js"],"names":["initAnalyticsSession","accountIDInit","appNameInit","analyticsURLInit","postIntervalSecondsInit","granularitySecInit","debug","let","accountID","appName","userID","sessionID","postIntervalSeconds","granularitySec","analyticsURL","postURL","serverConfig","DEFAULT_RETRY_TIME_IN_SECONDS","USERID_LOCAL_STORAGE_KEY","POST_LARGE_DATA_THRESHOLD_BYTES","currentAnalyticsEvent","eventData","IS_NODE_ENV","window","DEFAULT_BASE_URL","granularityTimer","postTimer","currentQuantisedTime","disabled","debugMode","debugLog","args","console","log","Error","_createAnalyticsEvent","schemaVersion","uuid","unixTimestampUTC","Date","numEventsTotal","events","_validateCurrentState","_retryPost","eventToSend","backoffCount","setTimeout","_postCurrentAnalyticsEvent","textToSend","_resetGranularityTimer","JSON","stringify","length","warn","fetch","method","headers","Content-Type","body","then","res","status","error","catch","debugError","disable","clearInterval","setInterval","_setupTimers","event","eventType","eventCategory","subCategory","eventCount","eventValue","_validateEvent","category","count","value","_ensureAnalyticsEventExists","time","valueCount","timeArray","modificationIndex","_updateExistingAnalyticsEvent","index","newValue","storedValueIsCount","newValueCount","storedValueObject","push","replace","localUserID","localStorage","getItem","crypto","randomUUID","setItem","_getOrCreateUserID","localSessionID","sessionStorage","Math","random","toString","substr","_getOrCreateSessionID","async","postIntervalSecondsInitial","granularitySecInitial","Promise","resolve","reject","configURL","serverResponse","json","err","_initFromRemoteConfig","analytics","_initData","_getCurrentAnalyticsEvent","parse","_getAppConfig"],"mappings":"AAwBA,SAASA,qBAAqBC,EAAeC,EAAaC,EACtDC,EAAyBC,EAAoBC,GAC7CC,IAAIC,EAAWC,EAASC,EAAQC,EAAWC,EACvCC,EAAgBC,EAAcC,EAASC,EAAa,GACxD,MACMC,EAAgC,GAEhCC,EAA2B,0BAC3BC,EAAkC,
|
|
1
|
+
{"version":3,"sourceRoot":"src/analytics.js","sources":["src/analytics.js"],"names":["initAnalyticsSession","accountIDInit","appNameInit","analyticsURLInit","postIntervalSecondsInit","granularitySecInit","debug","let","accountID","appName","userID","sessionID","postIntervalSeconds","granularitySec","analyticsURL","postURL","serverConfig","DEFAULT_RETRY_TIME_IN_SECONDS","USERID_LOCAL_STORAGE_KEY","SESSION_ID_LOCAL_STORAGE_KEY","POST_LARGE_DATA_THRESHOLD_BYTES","currentAnalyticsEvent","eventData","IS_NODE_ENV","window","DEFAULT_BASE_URL","granularityTimer","postTimer","currentQuantisedTime","disabled","debugMode","debugLog","args","console","log","Error","_createAnalyticsEvent","schemaVersion","uuid","unixTimestampUTC","Date","numEventsTotal","events","_validateCurrentState","_retryPost","eventToSend","backoffCount","setTimeout","_postCurrentAnalyticsEvent","textToSend","_resetGranularityTimer","JSON","stringify","length","warn","fetch","method","headers","Content-Type","body","then","res","status","error","catch","debugError","disable","clearInterval","setInterval","_setupTimers","event","eventType","eventCategory","subCategory","eventCount","eventValue","_validateEvent","category","count","value","_ensureAnalyticsEventExists","time","valueCount","timeArray","modificationIndex","_updateExistingAnalyticsEvent","index","newValue","storedValueIsCount","newValueCount","storedValueObject","push","replace","localUserID","localStorage","getItem","crypto","randomUUID","setItem","_getOrCreateUserID","localSessionID","sessionStorage","Math","random","toString","substr","_getOrCreateSessionID","async","postIntervalSecondsInitial","granularitySecInitial","Promise","resolve","reject","configURL","serverResponse","json","err","_initFromRemoteConfig","analytics","_initData","_getCurrentAnalyticsEvent","parse","_getAppConfig"],"mappings":"AAwBA,SAASA,qBAAqBC,EAAeC,EAAaC,EACtDC,EAAyBC,EAAoBC,GAC7CC,IAAIC,EAAWC,EAASC,EAAQC,EAAWC,EACvCC,EAAgBC,EAAcC,EAASC,EAAa,GACxD,MACMC,EAAgC,GAEhCC,EAA2B,0BAC3BC,EAA+B,6BAC/BC,EAAkC,IACxCb,IAAIc,EAAwB,KAC5B,IA2SQC,EA3SFC,EAAiC,oBAAXC,OAC5BjB,IAAIkB,EAAmB,4BAEnBC,EACAC,EACAC,EAAuB,EACvBC,GAAW,EACXC,GAAY,EAEhB,SAASC,KAAYC,GACbF,GAGJG,QAAQC,OAAOF,GAWnB,GAAGT,EACC,MAAM,IAAIY,MAAM,+CAGpB,SAASC,IACL,MAAO,CACHC,cAAe,EACf7B,UAAWA,EACXC,QAASA,EACT6B,KAAM5B,EACNC,UAAWA,EACX4B,kBAAmB,IAAIC,KACvBC,eAAgB,EAChBC,OAAQ,IAIhB,SAASC,IACL,IAAItB,EACA,MAAM,IAAIc,MAAM,4DAiCxB,SAASS,EAAWC,GAChBA,EAAYC,cAAgBD,EAAYC,cAAgB,GAAK,EAC7Df,yDACId,EAAgC4B,EAAYC,mBAChDC,WAAW,KACPC,EAA2BH,IACI,IAAhC5B,EAAuC4B,EAAYC,cAG1D,SAASE,EAA2BH,GAChC,IAYII,EAZ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AwCC,WAAwBC,GAC/Ee,GACCI,QAAQqB,4DAA4D9C,KAAaC,IAiG7F4G,CAAsBjH,EAAyBC,GAM/C,IAAQiB,KAAagG,UAAUC,UAC3BjD,KAAShD,GAEbgG,UAAUC,UAAY,GAGtBD,UAAUE,0BAlQV,WAGI,OAFA7E,IAEOQ,KAAKsE,MAAMtE,KAAKC,UAAU/B,KAgQrCiG,UAAUI,cApIV,WACI,MAAO,CACHlH,UAAAA,EAAWC,QAAAA,EAASoB,SAAAA,EACpBS,KAAM5B,EAAQC,UAAAA,EACdC,oBAAAA,EAAqBC,eAAAA,EAAgBC,aAAAA,EAAcE,aAAAA,IAmI3DsG,UAAUhD,MAAQA,EAlVlB9C,OAAO8F,YACP9F,OAAO8F,UAAY,CACfC,UAAW"}
|
package/package.json
CHANGED
package/src/analytics.js
CHANGED
|
@@ -30,6 +30,7 @@ function initAnalyticsSession(accountIDInit, appNameInit, analyticsURLInit,
|
|
|
30
30
|
const DEFAULT_RETRY_TIME_IN_SECONDS = 30;
|
|
31
31
|
const DEFAULT_POST_INTERVAL_SECONDS = 600; // 10 minutes
|
|
32
32
|
const USERID_LOCAL_STORAGE_KEY = 'aicore.analytics.userID';
|
|
33
|
+
const SESSION_ID_LOCAL_STORAGE_KEY = 'aicore.analytics.sessionID';
|
|
33
34
|
const POST_LARGE_DATA_THRESHOLD_BYTES = 10000;
|
|
34
35
|
let currentAnalyticsEvent = null;
|
|
35
36
|
const IS_NODE_ENV = (typeof window === 'undefined');
|
|
@@ -95,10 +96,10 @@ function initAnalyticsSession(accountIDInit, appNameInit, analyticsURLInit,
|
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
function _getOrCreateSessionID() {
|
|
98
|
-
let localSessionID = sessionStorage.getItem(
|
|
99
|
+
let localSessionID = sessionStorage.getItem(SESSION_ID_LOCAL_STORAGE_KEY);
|
|
99
100
|
if(!localSessionID){
|
|
100
101
|
localSessionID = Math.random().toString(36).substr(2, 10);
|
|
101
|
-
sessionStorage.setItem(
|
|
102
|
+
sessionStorage.setItem(SESSION_ID_LOCAL_STORAGE_KEY, localSessionID);
|
|
102
103
|
}
|
|
103
104
|
return localSessionID;
|
|
104
105
|
}
|