@capillarytech/cap-ui-utils 1.2.5 → 1.2.8
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/GA/index.js +4 -8
- package/package.json +1 -1
package/GA/index.js
CHANGED
|
@@ -67,11 +67,12 @@ const loadPerformanceTracking = module =>{
|
|
|
67
67
|
// Time to Interactive metric is essentially how long it takes for a user to be able to interact with your site.
|
|
68
68
|
// Time to Interactive is defined as the point at which the layout has stabilized, key webfonts are visible,
|
|
69
69
|
// and the main thread is available enough to handle user input.
|
|
70
|
-
ttiPolyfill.getFirstConsistentlyInteractive().then(
|
|
70
|
+
ttiPolyfill.getFirstConsistentlyInteractive().then(tti => {
|
|
71
|
+
const val = !tti ? 0 : tti;
|
|
71
72
|
ReactGA.timing({
|
|
72
73
|
category: "Time to Interactive",
|
|
73
74
|
variable: module,
|
|
74
|
-
value: Math.round(
|
|
75
|
+
value: Math.round((val).toFixed(2))
|
|
75
76
|
})
|
|
76
77
|
});
|
|
77
78
|
}catch(e){
|
|
@@ -111,9 +112,6 @@ const errorTracks = () => {
|
|
|
111
112
|
const message = [
|
|
112
113
|
'Message: ' + msg,
|
|
113
114
|
'URL: ' + url,
|
|
114
|
-
'LineNo: ' + lineNo,
|
|
115
|
-
'ColumnNo: ' + columnNo,
|
|
116
|
-
'Error object: ' + JSON.stringify(error),
|
|
117
115
|
].join(' - ');
|
|
118
116
|
tracker.trackException({
|
|
119
117
|
description: message,
|
|
@@ -147,8 +145,6 @@ const getCallerName = () => {
|
|
|
147
145
|
return nameTrace !== null ? nameTrace[1] || nameTrace[2] : '';
|
|
148
146
|
}
|
|
149
147
|
|
|
150
|
-
|
|
151
|
-
|
|
152
148
|
export default{
|
|
153
149
|
initialize,
|
|
154
150
|
timeTracker,
|
|
@@ -156,4 +152,4 @@ export default{
|
|
|
156
152
|
routeTrackerWrapper,
|
|
157
153
|
setCustomDimension,
|
|
158
154
|
getCallerName,
|
|
159
|
-
}
|
|
155
|
+
}
|