Track all link clicks (internal + external) in analytics; v1.1.33

Replaces outbound-only tracking with a useLinkClickTracking hook that
captures every <a> click on the site. Stores as link_click events keyed
by destination URL, with an internal flag. Admin analytics page gains a
Link Clicks table sorted by count, showing type (internal/external).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nmemmert
2026-08-10 09:11:53 -04:00
parent abb4c87c41
commit bf3154378b
7 changed files with 73 additions and 12 deletions
+1
View File
@@ -601,6 +601,7 @@ export interface AdminStats {
scrollDepth: Array<{ path: string; 25?: number; 50?: number; 75?: number; 90?: number }>
timeOnPage: Array<{ path: string; avgSeconds: number; count: number }>
topOutboundClicks: Array<{ url: string; count: number }>
topLinkClicks: Array<{ url: string; count: number; internal: boolean }>
topUTMSources: Array<{ source: string; count: number }>
topSearchQueries: Array<{ query: string; count: number }>
top404s: Array<{ path: string; count: number }>