Sfoglia il codice sorgente

feat(analytics): include MatomoHandler by default

master
ludovicm67 5 anni fa
parent
commit
bdd129b9a2

+ 0
- 2
Makefile Vedi File

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

+ 2
- 3
config.js Vedi File

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

+ 8
- 1
react/features/analytics/functions.js Vedi File

@@ -10,7 +10,7 @@ import {
10 10
     checkChromeExtensionsInstalled,
11 11
     isMobileBrowser
12 12
 } from '../base/environment/utils';
13
-import { AmplitudeHandler } from './handlers';
13
+import { AmplitudeHandler, MatomoHandler } from './handlers';
14 14
 import logger from './logger';
15 15
 
16 16
 /**
@@ -94,6 +94,13 @@ export function createHandlers({ getState }: { getState: Function }) {
94 94
     // eslint-disable-next-line no-empty
95 95
     } catch (e) {}
96 96
 
97
+    try {
98
+        const matomo = new MatomoHandler(handlerConstructorOptions);
99
+
100
+        handlers.push(matomo);
101
+    // eslint-disable-next-line no-empty
102
+    } catch (e) {}
103
+
97 104
     return (
98 105
         _loadHandlers(scriptURLs, handlerConstructorOptions)
99 106
             .then(externalHandlers => {

+ 1
- 1
react/features/analytics/handlers/MatomoHandler.js Vedi File

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

+ 1
- 0
react/features/analytics/handlers/index.js Vedi File

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

+ 0
- 6
webpack.config.js Vedi File

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

Loading…
Annulla
Salva