From 0aa1e664867dd375767fba4d222988fbffdcec45 Mon Sep 17 00:00:00 2001 From: Milos Vetesnik Date: Mon, 19 Jun 2023 11:18:28 +0200 Subject: [PATCH] feat: simple analitycs (#6683) * Simple analytics for iframe and webpage * added logic for tracking specific categories of events to reduce it * enviroment vars clean up * fix: lint for index.html --- .env.development | 6 +--- .env.production | 11 +------- public/index.html | 71 ++++++++++++++++++++++------------------------- src/analytics.ts | 19 ++++--------- 4 files changed, 40 insertions(+), 67 deletions(-) diff --git a/.env.development b/.env.development index 0c2fb552..c56b62b3 100644 --- a/.env.development +++ b/.env.development @@ -20,14 +20,10 @@ REACT_APP_DEV_ENABLE_SW= # whether to disable live reload / HMR. Usuaully what you want to do when # debugging Service Workers. REACT_APP_DEV_DISABLE_LIVE_RELOAD= +REACT_APP_DISABLE_TRACKING=true FAST_REFRESH=false -# MATOMO -REACT_APP_MATOMO_URL= -REACT_APP_CDN_MATOMO_TRACKER_URL= -REACT_APP_MATOMO_SITE_ID= - #Debug flags # To enable bounding box for text containers diff --git a/.env.production b/.env.production index 8737c63c..b86aa4bc 100644 --- a/.env.production +++ b/.env.production @@ -11,14 +11,5 @@ REACT_APP_WS_SERVER_URL= REACT_APP_FIREBASE_CONFIG='{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}' -# production-only vars -# GOOGLE ANALYTICS -REACT_APP_GOOGLE_ANALYTICS_ID=UA-387204-13 -# MATOMO -REACT_APP_MATOMO_URL=https://excalidraw.matomo.cloud/ -REACT_APP_CDN_MATOMO_TRACKER_URL=//cdn.matomo.cloud/excalidraw.matomo.cloud/matomo.js -REACT_APP_MATOMO_SITE_ID=1 - - - REACT_APP_PLUS_APP=https://app.excalidraw.com +REACT_APP_DISABLE_TRACKING= diff --git a/public/index.html b/public/index.html index f65e481f..5509ded8 100644 --- a/public/index.html +++ b/public/index.html @@ -148,33 +148,6 @@ // setting this so that libraries installation reuses this window tab. window.name = "_excalidraw"; - <% if (process.env.REACT_APP_DISABLE_TRACKING !== 'true') { %> - - - - - - - <% if (process.env.REACT_APP_GOOGLE_ANALYTICS_ID) { %> - - - <% } %> - - <% } %>