diff --git a/client/src/components/ReadOnlyViewer.tsx b/client/src/components/ReadOnlyViewer.tsx index 3754ea1..7420657 100644 --- a/client/src/components/ReadOnlyViewer.tsx +++ b/client/src/components/ReadOnlyViewer.tsx @@ -1,6 +1,7 @@ import { useState, useEffect } from 'react' import { useTranslation } from 'react-i18next' import { decryptJson } from '../services/crypto.js' +import { PlausibleEvents, trackPlausibleEvent } from '../services/analytics.js' import VesselForm from './VesselForm.tsx' import CrewForm from './CrewForm.tsx' import LogEntriesList from './LogEntriesList.tsx' @@ -124,6 +125,7 @@ export default function ReadOnlyViewer({ token, hexKey }: ReadOnlyViewerProps) { } } setGpsTracks(decGpsTracks) + trackPlausibleEvent(PlausibleEvents.PUBLIC_LINK_OPENED) } catch (err: any) { console.error(err) diff --git a/client/src/components/SettingsForm.tsx b/client/src/components/SettingsForm.tsx index 5717d68..3e6ba43 100644 --- a/client/src/components/SettingsForm.tsx +++ b/client/src/components/SettingsForm.tsx @@ -111,6 +111,7 @@ export default function SettingsForm({ logbookId, onLogbookRestored }: SettingsF const logbookKey = await ensureLogbookKey(logbookId) const hexKey = bufferToHex(logbookKey) setShareLink(`${window.location.origin}/share?token=${data.token}#key=${hexKey}`) + trackPlausibleEvent(PlausibleEvents.LOGBOOK_SHARED) showAlert('Public share link enabled!') } else { setShareEnabled(false) diff --git a/client/src/services/analytics.ts b/client/src/services/analytics.ts index ae0ac90..105e9ee 100644 --- a/client/src/services/analytics.ts +++ b/client/src/services/analytics.ts @@ -14,6 +14,8 @@ export const PlausibleEvents = { ONBOARDING_TOUR_SKIPPED: 'Onboarding Tour Skipped', INVITE_GENERATED: 'Invite Generated', INVITE_ACCEPTED: 'Invite Accepted', + LOGBOOK_SHARED: 'Logbook Shared', + PUBLIC_LINK_OPENED: 'Public Link Opened', PDF_EXPORTED: 'PDF Exported', CSV_EXPORTED: 'CSV Exported', CSV_SHARED: 'CSV Shared', diff --git a/docs/plausible-events.md b/docs/plausible-events.md index 2e32a08..9322e90 100644 --- a/docs/plausible-events.md +++ b/docs/plausible-events.md @@ -29,6 +29,8 @@ Kapteins Daagbok nutzt [Plausible Analytics](https://plausible.io/) mit dem Scri | Demo Opened | Public-Demo unter `/demo` geöffnet (`DemoViewer.tsx`) | — | | Invite Generated | Einladungslink erzeugt (`SettingsForm.tsx`) | — | | Invite Accepted | Einladung angenommen und Logbuch beigetreten (`InvitationAcceptance.tsx`) | — | +| Logbook Shared | Öffentlicher Freigabelink aktiviert (`SettingsForm.tsx`) | — | +| Public Link Opened | Freigabelink unter `/share` erfolgreich geladen (`ReadOnlyViewer.tsx`) | — | | PDF Exported | PDF-Export eines Reisetags (`LogEntryEditor.tsx`, `LogEntriesList.tsx`) | `scope`: `entry` | | CSV Exported | CSV-Download aus der Eintragsliste (`LogEntriesList.tsx`) | — | | CSV Shared | CSV über Web Share API geteilt (`LogEntriesList.tsx`) | — | @@ -52,8 +54,9 @@ Empfohlene Goal-Ketten für Auswertung: 1. **Aktivierung:** Account Created → Logbook Created → Travel Day Created → Travel Day Saved 2. **Onboarding:** Account Created → Onboarding Tour Completed (vs. Onboarding Tour Skipped) 3. **Kollaboration:** Invite Generated → Invite Accepted -4. **Export:** Travel Day Saved → PDF Exported / CSV Exported -5. **Datensicherung:** Backup Exported → Backup Restored +4. **Öffentliche Freigabe:** Logbook Shared → Public Link Opened +5. **Export:** Travel Day Saved → PDF Exported / CSV Exported +6. **Datensicherung:** Backup Exported → Backup Restored ## Entwicklung