Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(analytics): include MatomoHandler by default

ludovicm67bdd129b9a2c6
diff --git a/Makefile b/Makefile
index 7b0733e2a9..0cb668e53c 100644
--- a/Makefile
+++ b/Makefile
@@ -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 \
diff --git a/config.js b/config.js
index 5e03cd3b1b..6504e47a6b 100644
--- a/config.js
+++ b/config.js
@@ -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"
// ],
},
diff --git a/react/features/analytics/functions.js b/react/features/analytics/functions.js
index 6dd66cd60c..fb183eec17 100644
--- a/react/features/analytics/functions.js
+++ b/react/features/analytics/functions.js
@@ -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 => {
diff --git a/react/features/analytics/handlers/MatomoHandler.js b/react/features/analytics/handlers/MatomoHandler.js
index 5efba61029..1dd69b001e 100644
--- a/react/features/analytics/handlers/MatomoHandler.js
+++ b/react/features/analytics/handlers/MatomoHandler.js
@@ -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.
diff --git a/react/features/analytics/handlers/index.js b/react/features/analytics/handlers/index.js
index 9d56d43dc2..e019d26006 100644
--- a/react/features/analytics/handlers/index.js
+++ b/react/features/analytics/handlers/index.js
@@ -1 +1,2 @@
export { default as AmplitudeHandler } from './AmplitudeHandler';
+export { default as MatomoHandler } from './MatomoHandler';
diff --git a/webpack.config.js b/webpack.config.js
index a8d577a813..72407cfe54 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -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,