Skip to content

Commit 2ef6bc1

Browse files
committed
Use separate try catch statements
1 parent aef5de5 commit 2ef6bc1

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

packages/common/utils/analytics.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,19 @@ export default function track(eventName, secondArg: Object = {}) {
2828
version: VERSION,
2929
path: location.pathname + location.search,
3030
};
31-
if (window.ga) {
32-
window.ga('send', data);
31+
try {
32+
if (window.ga) {
33+
window.ga('send', data);
34+
}
35+
} catch (e) {
36+
/* */
3337
}
34-
if (typeof window.amplitude !== 'undefined') {
35-
window.amplitude.logEvent(eventName, data);
38+
try {
39+
if (typeof window.amplitude !== 'undefined') {
40+
window.amplitude.logEvent(eventName, data);
41+
}
42+
} catch (e) {
43+
/* */
3644
}
3745
}
3846
} catch (e) {

0 commit comments

Comments
 (0)