From 08ecf37a92cf1e94c82d5a47f1f27a02ea6c70f9 Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Thu, 5 Dec 2024 17:21:46 +0100 Subject: [PATCH] another try of umami analytics --- docs/src/components/Interpreter/index.tsx | 4 ++++ docs/src/theme/Footer/Layout/index.js | 1 + 2 files changed, 5 insertions(+) diff --git a/docs/src/components/Interpreter/index.tsx b/docs/src/components/Interpreter/index.tsx index aff8e347..7cd80c8e 100644 --- a/docs/src/components/Interpreter/index.tsx +++ b/docs/src/components/Interpreter/index.tsx @@ -20,6 +20,10 @@ function track(type: string, command: string) { if (_paq) { _paq.push(['trackEvent', 'REPL', type, command]); } + const umami = globalThis.umami as any; + if (umami) { + umami.track('REPL', { type, command }); + } } type PiwikTrack = Array>; diff --git a/docs/src/theme/Footer/Layout/index.js b/docs/src/theme/Footer/Layout/index.js index 8a8e7e46..874e8e89 100644 --- a/docs/src/theme/Footer/Layout/index.js +++ b/docs/src/theme/Footer/Layout/index.js @@ -56,6 +56,7 @@ owa_cmds.push(['trackClicks']); _paq.push(['setSiteId', w]); g.type='text/javascript';g.async=true;g.defer=true;g.src=i;s.parentNode.insertBefore(g,s); })('https://jcubic.piwik.pro/ppms.php','https://jcubic.containers.piwik.pro/ppms.js','018719ec\u002D6793\u002D4a2d\u002D92f9\u002Db8b88a01d43c',document)`}}/> +