From a37879544c82d9cd5294b9ee6bb65e73caa5f4ff Mon Sep 17 00:00:00 2001 From: Eric Fennis Date: Wed, 28 Oct 2026 08:49:32 +0100 Subject: [PATCH] chore(docs|site): Remove Plausible, add tracking events and privacy statement (#5092) * feat(docs): track homepage, icons page and icon drawer interactions with OpenPanel Adds track/trackDebounced helpers around the shared OpenPanel instance and sends events for hero actions, home search, packages, the style customizers, homepage scroll depth, icon search (start, queries, no results), sort, Lab library toggle, and the drawer's See in action, copy and studio buttons. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011GcWdCmSmcDiiAazR5mNUD * feat(docs): send homepage scroll depth once on page leave Instead of one event per milestone, record the deepest scroll position and send a single home_scroll_depth event (percent + milestone) when the visitor navigates away, closes the tab, or hides it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011GcWdCmSmcDiiAazR5mNUD * feat(docs): simplify scroll depth tracking to the position on page leave Drop the max-depth composable and send a single scroll_depth event with the current scroll percentage before a route change and on visibilitychange, pagehide and beforeunload, for every page. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011GcWdCmSmcDiiAazR5mNUD * refactor(docs): move scroll depth tracking into the OpenPanel utils Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011GcWdCmSmcDiiAazR5mNUD * refactor(docs): move router and browser tracking setup into the OpenPanel utils Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011GcWdCmSmcDiiAazR5mNUD * Add privacy-policy * adjust text * Remove plausible --------- Co-authored-by: Claude --- docs/.vitepress/getHeadConfig.ts | 15 --- .../theme/components/home/HomeHeroAfter.vue | 34 +++--- .../components/home/HomeIconCustomizer.vue | 15 ++- .../components/home/HomePackagesSection.vue | 29 +++-- .../theme/components/icons/CopyCodeButton.vue | 14 ++- .../theme/components/icons/CopySVGButton.vue | 10 ++ .../components/icons/EditInStudioButton.vue | 17 ++- .../theme/components/icons/IconInfo.vue | 17 ++- .../theme/components/icons/IconsOverview.vue | 30 +++++- .../icons/SidebarExternalLibrarySelect.vue | 21 ++-- .../icons/SidebarIconCustomizer.vue | 15 ++- .../theme/composables/useTrackStyleChanges.ts | 21 ++++ docs/.vitepress/theme/index.ts | 7 +- docs/.vitepress/theme/utils/openpanel.ts | 102 +++++++++++++++++- docs/privacy.md | 76 +++++++++++++ 15 files changed, 358 insertions(+), 65 deletions(-) create mode 100644 docs/.vitepress/theme/composables/useTrackStyleChanges.ts create mode 100644 docs/privacy.md diff --git a/docs/.vitepress/getHeadConfig.ts b/docs/.vitepress/getHeadConfig.ts index 82b742f82..3399c1f4e 100644 --- a/docs/.vitepress/getHeadConfig.ts +++ b/docs/.vitepress/getHeadConfig.ts @@ -9,13 +9,6 @@ const getHeadConfig = ({ description: string; socialTitle?: string; }): HeadConfig[] => [ - [ - 'link', - { - rel: 'preconnect', - href: 'https://analytics.lucide.dev', - }, - ], [ 'link', { @@ -23,14 +16,6 @@ const getHeadConfig = ({ href: 'https://insights.lucide.dev', }, ], - [ - 'script', - { - src: 'https://analytics.lucide.dev/js/script.js', - 'data-domain': 'lucide.dev', - defer: '', - }, - ], [ 'meta', { diff --git a/docs/.vitepress/theme/components/home/HomeHeroAfter.vue b/docs/.vitepress/theme/components/home/HomeHeroAfter.vue index 38a64d14b..6c80cecf8 100644 --- a/docs/.vitepress/theme/components/home/HomeHeroAfter.vue +++ b/docs/.vitepress/theme/components/home/HomeHeroAfter.vue @@ -2,41 +2,46 @@ import { useRouter } from 'vitepress'; import Badge from '../base/Badge.vue'; import HomeContainer from './HomeContainer.vue'; -import { data } from './HomeHeroIconsCard.data' -import FakeInput from '../base/FakeInput.vue' -import { nextTick, provide } from 'vue' +import { data } from './HomeHeroIconsCard.data'; +import FakeInput from '../base/FakeInput.vue'; +import { nextTick, provide } from 'vue'; import useSearchShortcut from '../../utils/useSearchShortcut'; +import { track } from '../../utils/openpanel'; -const { go } = useRouter() +const { go } = useRouter(); const { shortcutText: kbdSearchShortcut } = useSearchShortcut(() => { - go('/icons/?focus') -}) + track('home_search_click', { via: 'shortcut' }); + go('/icons/?focus'); +}); + +function onSearchClick() { + track('home_search_click', { via: 'click' }); + go('/icons/?focus'); +} const enableTransitions = () => 'startViewTransition' in document && - window.matchMedia('(prefers-reduced-motion: no-preference)').matches - + window.matchMedia('(prefers-reduced-motion: no-preference)').matches; async function handleClick(event: MouseEvent) { if (!enableTransitions()) { - go('/icons/?focus') + go('/icons/?focus'); return; } - await document.startViewTransition(async () => { await go('/icons/?focus'); - await nextTick() - }).ready + await nextTick(); + }).ready; } @@ -47,5 +52,4 @@ async function handleClick(event: MouseEvent) { width: 100%; margin-top: 24px; } - diff --git a/docs/.vitepress/theme/components/home/HomeIconCustomizer.vue b/docs/.vitepress/theme/components/home/HomeIconCustomizer.vue index b5599fedc..5e752549d 100644 --- a/docs/.vitepress/theme/components/home/HomeIconCustomizer.vue +++ b/docs/.vitepress/theme/components/home/HomeIconCustomizer.vue @@ -1,5 +1,5 @@