Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/sovereign-intelligence/blob/main/docs/archive/drakestapleton.com-old/src/lib/tracking.ts # sovereign-intelligence Front door to Drake Stapleton's sovereign stack. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `sovereign-intelligence / docs / archive / drakestapleton.com-old / src / lib / tracking.ts` 24 lines ยท 590 bytes Raw Blame History 1 declare global { 2 interface Window { 3 dataLayer?: unknown[]; 4 gtag?: (...args: unknown[]) => void; 5 } 6 } 7 8 export function trackEvent(action: string, params: Record = {}) { 9 if (typeof window === "undefined") { 10 return; 11 } 12 if (typeof window.gtag === "function") { 13 window.gtag("event", action, params); 14 } 15 } 16 17 export function trackRepoOutbound(repoName: string, destinationUrl: string) { 18 trackEvent("repo_outbound_click", { 19 repo_name: repoName, 20 destination_url: destinationUrl, 21 event_category: "engagement", 22 event_label: repoName, 23 }); 24 }