@@ -20,9 +20,19 @@ import { CiLogin } from 'react-icons/ci';
2020import { SiNpm , SiFarcaster } from 'react-icons/si' ;
2121import { FcGoogle } from 'react-icons/fc' ;
2222import { FaSquareXTwitter } from 'react-icons/fa6' ;
23+ import { trackEvent } from '@/app/lib/mixpanelClient' ;
2324
2425export function Introduction ( ) {
2526 const { connection } = useWallet ( ) ;
27+
28+ const trackExternalLink = ( destination : string ) => {
29+ trackEvent ( 'External Link Click' , {
30+ destination,
31+ isConnected : connection . isConnected ,
32+ source : 'Introduction' ,
33+ } ) ;
34+ } ;
35+
2636 const basePath = process . env . basePath ?? '' ;
2737 return (
2838 < Box
@@ -68,6 +78,9 @@ export function Introduction() {
6878 colorScheme = "gray"
6979 size = "lg"
7080 width = "100%"
81+ onClick = { ( ) =>
82+ trackExternalLink ( 'documentation' )
83+ }
7184 >
7285 Get Started with our Docs
7386 </ Button >
@@ -85,6 +98,7 @@ export function Introduction() {
8598 rel = "noopener noreferrer"
8699 colorScheme = "red"
87100 width = "100%"
101+ onClick = { ( ) => trackExternalLink ( 'npm' ) }
88102 >
89103 View Package on NPM
90104 </ Button >
@@ -96,6 +110,7 @@ export function Introduction() {
96110 rel = "noopener noreferrer"
97111 colorScheme = "gray"
98112 width = "100%"
113+ onClick = { ( ) => trackExternalLink ( 'github' ) }
99114 >
100115 View GitHub Repository
101116 </ Button >
@@ -114,6 +129,9 @@ export function Introduction() {
114129 rel = "noopener noreferrer"
115130 variant = "outline"
116131 width = "100%"
132+ onClick = { ( ) =>
133+ trackExternalLink ( 'smart-accounts' )
134+ }
117135 >
118136 Learn about Smart Accounts
119137 </ Button >
@@ -273,6 +291,11 @@ export function Introduction() {
273291 as = { Link }
274292 href = { app . href }
275293 isExternal
294+ onClick = { ( ) =>
295+ trackExternalLink (
296+ `example-app-${ app . name . toLowerCase ( ) } ` ,
297+ )
298+ }
276299 >
277300 < HStack
278301 align = "start"
0 commit comments