Skip to content

Commit 0cddfe7

Browse files
committed
Enhance navigation and project card links with Umami event tracking
1 parent 6912ec6 commit 0cddfe7

2 files changed

Lines changed: 24 additions & 4 deletions

File tree

components/navbar/index.jsx

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,32 @@ function NavBar() {
3636

3737
<div id="navbarMenu" className={navbarMenuClassNames}>
3838
<div className="navbar-start">
39-
<Link href="/" className="navbar-item">
39+
<Link
40+
href="/"
41+
className="navbar-item"
42+
data-umami-event="home_link_click"
43+
data-umami-event-type="click"
44+
>
4045
Home
4146
</Link>
4247

43-
<Link href="/projects" className="navbar-item">
48+
<Link
49+
href="/projects"
50+
className="navbar-item"
51+
data-umami-event="projects_link_click"
52+
data-umami-event-type="click"
53+
>
4454
Projects
4555
</Link>
4656

47-
<Link href={Profile.cv} className="navbar-item" target="_blank" rel="noopener noreferrer">
57+
<Link
58+
href={Profile.cv}
59+
className="navbar-item"
60+
target="_blank"
61+
rel="noopener noreferrer"
62+
data-umami-event="cv_link_click"
63+
data-umami-event-type="click"
64+
>
4865
CV
4966
</Link>
5067
</div>

components/project-card/index.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ function ProjectCard({
2525
className="has-text-centered"
2626
target={link.target}
2727
rel={link.rel}
28+
data-umami-event={`project_${link.label.toLowerCase()}_click`}
29+
data-umami-event-type="click"
2830
>
2931
{link.label}
3032
</Link>
@@ -63,7 +65,8 @@ ProjectCard.propTypes = {
6365
PropTypes.shape({
6466
label: PropTypes.string,
6567
url: PropTypes.string,
66-
target: PropTypes.string
68+
target: PropTypes.string,
69+
rel: PropTypes.string,
6770
})
6871
)
6972
}

0 commit comments

Comments
 (0)