analytics: don't initialize handlers if they are not properly configured
This commit is contained in:
committed by
Saúl Ibarra Corretgé
parent
08891b17b6
commit
6bbc2927ab
@@ -1,8 +1,6 @@
|
||||
import AbstractHandler from './AbstractHandler';
|
||||
import { amplitude } from './amplitude';
|
||||
|
||||
const logger = require('jitsi-meet-logger').getLogger(__filename);
|
||||
|
||||
/**
|
||||
* Analytics handler for Amplitude.
|
||||
*/
|
||||
@@ -20,10 +18,7 @@ export default class AmplitudeHandler extends AbstractHandler {
|
||||
const { amplitudeAPPKey, host } = options;
|
||||
|
||||
if (!amplitudeAPPKey) {
|
||||
logger.warn(
|
||||
'Failed to initialize Amplitude handler, no APP key');
|
||||
|
||||
return;
|
||||
throw new Error('Failed to initialize Amplitude handler, no APP key');
|
||||
}
|
||||
|
||||
this._enabled = true;
|
||||
|
||||
@@ -4,8 +4,6 @@ import { getJitsiMeetGlobalNS } from '../../base/util';
|
||||
|
||||
import AbstractHandler from './AbstractHandler';
|
||||
|
||||
const logger = require('jitsi-meet-logger').getLogger(__filename);
|
||||
|
||||
/**
|
||||
* Analytics handler for Google Analytics.
|
||||
*/
|
||||
@@ -24,11 +22,7 @@ class GoogleAnalyticsHandler extends AbstractHandler {
|
||||
this._userProperties = {};
|
||||
|
||||
if (!options.googleAnalyticsTrackingId) {
|
||||
logger.warn(
|
||||
'Failed to initialize Google Analytics handler, no tracking ID'
|
||||
);
|
||||
|
||||
return;
|
||||
throw new Error('Failed to initialize Google Analytics handler, no tracking ID');
|
||||
}
|
||||
|
||||
this._enabled = true;
|
||||
|
||||
Reference in New Issue
Block a user