From 084ad5cfb9e2051ccae29ef9c1078154daa125be Mon Sep 17 00:00:00 2001 From: David Montero Crespo Date: Wed, 25 Mar 2026 03:05:38 -0300 Subject: [PATCH 1/2] fix: remove redundant console log in handleLoadExample function --- frontend/src/pages/ExamplesPage.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/src/pages/ExamplesPage.tsx b/frontend/src/pages/ExamplesPage.tsx index 5f67d6d..934357e 100644 --- a/frontend/src/pages/ExamplesPage.tsx +++ b/frontend/src/pages/ExamplesPage.tsx @@ -38,9 +38,6 @@ export const ExamplesPage: React.FC = () => { const missing = libs.filter((l) => !installedNames.has(l.toLowerCase())); if (missing.length === 0) return; - const handleLoadExample = (example: ExampleProject) => { - console.log('Loading example:', example.title); - trackOpenExample(example.title); setInstalling({ total: missing.length, done: 0, current: missing[0] }); for (let i = 0; i < missing.length; i++) { setInstalling({ total: missing.length, done: i, current: missing[i] }); @@ -54,6 +51,7 @@ export const ExamplesPage: React.FC = () => { }; const handleLoadExample = async (example: ExampleProject) => { + trackOpenExample(example.title); // Auto-install required libraries before loading if (example.libraries && example.libraries.length > 0) { await ensureLibraries(example.libraries); From f127ef6cbe46a181c24f5bcf1ac9b34304bcd4d0 Mon Sep 17 00:00:00 2001 From: David Montero Crespo Date: Wed, 25 Mar 2026 03:06:38 -0300 Subject: [PATCH 2/2] Enhance analytics tracking across the application - Added tracking for simulation events: start, stop, and reset. - Implemented tracking for library manager interactions, including library installations. - Enhanced project management tracking with save and create project events. - Integrated tracking for user authentication events: sign-up and login. - Added tracking for CTA clicks on landing and SEO pages. - Updated analytics utility functions to support new tracking events. - Improved GitHub and Discord link tracking in the app header. - Refactored existing components to utilize new tracking functions for better user engagement insights. --- .../src/components/editor/EditorToolbar.tsx | 9 +- frontend/src/components/layout/AppHeader.tsx | 6 +- .../components/layout/SaveProjectModal.tsx | 3 +- .../simulator/LibraryManagerModal.tsx | 2 + .../components/simulator/SimulatorCanvas.tsx | 6 +- frontend/src/pages/ArduinoEmulatorPage.tsx | 5 +- .../src/pages/ArduinoMegaSimulatorPage.tsx | 5 +- frontend/src/pages/ArduinoSimulatorPage.tsx | 5 +- frontend/src/pages/AtmegaSimulatorPage.tsx | 5 +- frontend/src/pages/Esp32C3SimulatorPage.tsx | 5 +- frontend/src/pages/Esp32S3SimulatorPage.tsx | 5 +- frontend/src/pages/Esp32SimulatorPage.tsx | 5 +- frontend/src/pages/LandingPage.tsx | 4 +- frontend/src/pages/LoginPage.tsx | 4 +- .../pages/RaspberryPiPicoSimulatorPage.tsx | 5 +- .../src/pages/RaspberryPiSimulatorPage.tsx | 5 +- frontend/src/pages/RegisterPage.tsx | 4 +- frontend/src/pages/Velxio2Page.tsx | 5 +- frontend/src/utils/analytics.ts | 94 ++++++++++++++++++- 19 files changed, 145 insertions(+), 37 deletions(-) diff --git a/frontend/src/components/editor/EditorToolbar.tsx b/frontend/src/components/editor/EditorToolbar.tsx index 876d78a..07cbb6a 100644 --- a/frontend/src/components/editor/EditorToolbar.tsx +++ b/frontend/src/components/editor/EditorToolbar.tsx @@ -11,7 +11,7 @@ import { InstallLibrariesModal } from '../simulator/InstallLibrariesModal'; import { parseCompileResult } from '../../utils/compilationLogger'; import type { CompilationLog } from '../../utils/compilationLogger'; import { exportToWokwiZip, importFromWokwiZip } from '../../utils/wokwiZip'; -import { trackCompileCode, trackRunSimulation } from '../../utils/analytics'; +import { trackCompileCode, trackRunSimulation, trackStopSimulation, trackResetSimulation, trackOpenLibraryManager } from '../../utils/analytics'; import './EditorToolbar.css'; interface EditorToolbarProps { @@ -160,6 +160,7 @@ export const EditorToolbar = ({ consoleOpen, setConsoleOpen, compileLogs: _compi const board = boards.find((b) => b.id === activeBoardId); const isQemuBoard = board?.boardKind === 'raspberry-pi-3' || board?.boardKind === 'esp32' || board?.boardKind === 'esp32-s3'; if (isQemuBoard || board?.compiledProgram) { + trackRunSimulation(board?.boardKind); startBoard(activeBoardId); setMessage(null); return; @@ -176,12 +177,14 @@ export const EditorToolbar = ({ consoleOpen, setConsoleOpen, compileLogs: _compi }; const handleStop = () => { + trackStopSimulation(); if (activeBoardId) stopBoard(activeBoardId); else stopSimulation(); setMessage(null); }; const handleReset = () => { + trackResetSimulation(); if (activeBoardId) resetBoard(activeBoardId); else resetSimulation(); setMessage(null); @@ -431,7 +434,7 @@ export const EditorToolbar = ({ consoleOpen, setConsoleOpen, compileLogs: _compi {/* Library Manager — always visible with label */}