feat(analytics): include MatomoHandler by default

This commit is contained in:
ludovicm67 2020-04-29 12:40:04 +02:00 committed by Saúl Ibarra Corretgé
parent 4c635a2a63
commit bdd129b9a2
6 changed files with 12 additions and 13 deletions

View File

@ -46,8 +46,6 @@ deploy-appbundle:
$(OUTPUT_DIR)/analytics-ga.js \ $(OUTPUT_DIR)/analytics-ga.js \
$(BUILD_DIR)/analytics-ga.min.js \ $(BUILD_DIR)/analytics-ga.min.js \
$(BUILD_DIR)/analytics-ga.min.map \ $(BUILD_DIR)/analytics-ga.min.map \
$(BUILD_DIR)/analytics-matomo.min.js \
$(BUILD_DIR)/analytics-matomo.min.map \
$(BUILD_DIR)/video-blur-effect.min.js \ $(BUILD_DIR)/video-blur-effect.min.js \
$(BUILD_DIR)/video-blur-effect.min.map \ $(BUILD_DIR)/video-blur-effect.min.map \
$(BUILD_DIR)/rnnoise-processor.min.js \ $(BUILD_DIR)/rnnoise-processor.min.js \

View File

@ -380,9 +380,8 @@ var config = {
// Array of script URLs to load as lib-jitsi-meet "analytics handlers". // Array of script URLs to load as lib-jitsi-meet "analytics handlers".
// scriptURLs: [ // scriptURLs: [
// "libs/analytics-ga.min.js", // google-analytics // "libs/analytics-ga.min.js", // google-analytics
// "libs/analytics-matomo.min.js", // Matomo // "https://example.com/my-custom-analytics.js"
// "https://example.com/my-custom-analytics.js"
// ], // ],
}, },

View File

@ -10,7 +10,7 @@ import {
checkChromeExtensionsInstalled, checkChromeExtensionsInstalled,
isMobileBrowser isMobileBrowser
} from '../base/environment/utils'; } from '../base/environment/utils';
import { AmplitudeHandler } from './handlers'; import { AmplitudeHandler, MatomoHandler } from './handlers';
import logger from './logger'; import logger from './logger';
/** /**
@ -94,6 +94,13 @@ export function createHandlers({ getState }: { getState: Function }) {
// eslint-disable-next-line no-empty // eslint-disable-next-line no-empty
} catch (e) {} } catch (e) {}
try {
const matomo = new MatomoHandler(handlerConstructorOptions);
handlers.push(matomo);
// eslint-disable-next-line no-empty
} catch (e) {}
return ( return (
_loadHandlers(scriptURLs, handlerConstructorOptions) _loadHandlers(scriptURLs, handlerConstructorOptions)
.then(externalHandlers => { .then(externalHandlers => {

View File

@ -7,7 +7,7 @@ import AbstractHandler from './AbstractHandler';
/** /**
* Analytics handler for Matomo. * Analytics handler for Matomo.
*/ */
class MatomoHandler extends AbstractHandler { export default class MatomoHandler extends AbstractHandler {
/** /**
* Creates new instance of the Matomo handler. * Creates new instance of the Matomo handler.

View File

@ -1 +1,2 @@
export { default as AmplitudeHandler } from './AmplitudeHandler'; export { default as AmplitudeHandler } from './AmplitudeHandler';
export { default as MatomoHandler } from './MatomoHandler';

View File

@ -217,12 +217,6 @@ module.exports = [
}, },
performance: getPerformanceHints(5 * 1024) performance: getPerformanceHints(5 * 1024)
}), }),
Object.assign({}, config, {
entry: {
'analytics-matomo': './react/features/analytics/handlers/MatomoHandler.js'
},
performance: getPerformanceHints(5 * 1024)
}),
// Because both video-blur-effect and rnnoise-processor modules are loaded // Because both video-blur-effect and rnnoise-processor modules are loaded
// in a lazy manner using the loadScript function with a hard coded name, // in a lazy manner using the loadScript function with a hard coded name,