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 \
$(BUILD_DIR)/analytics-ga.min.js \
$(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.map \
$(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".
// scriptURLs: [
// "libs/analytics-ga.min.js", // google-analytics
// "libs/analytics-matomo.min.js", // Matomo
// "https://example.com/my-custom-analytics.js"
// "libs/analytics-ga.min.js", // google-analytics
// "https://example.com/my-custom-analytics.js"
// ],
},

View File

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

View File

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

View File

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

View File

@ -217,12 +217,6 @@ module.exports = [
},
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
// in a lazy manner using the loadScript function with a hard coded name,