File tree Expand file tree Collapse file tree 2 files changed +30
-4
lines changed
Expand file tree Collapse file tree 2 files changed +30
-4
lines changed Original file line number Diff line number Diff line change @@ -6,16 +6,16 @@ const today = new Date();
66 <div class =" content" >
77 © { today .getFullYear ()} - UmYeah.dev
88 <span class =" social-links" >
9- <a href =" https://github.com/umyeah" target =" _blank" onclick = " window . umami ? . track ( ' github-click ' ) " >
9+ <a href =" https://github.com/umyeah" target =" _blank" >
1010 <i class =" fa-brands fa-github" ></i >
1111 </a >
12- <a href =" https://www.linkedin.com/in/corey-sherman-aa12a611/" target =" _blank" onclick = " window . umami ? . track ( ' linkedin-click ' ) " >
12+ <a href =" https://www.linkedin.com/in/corey-sherman-aa12a611/" target =" _blank" >
1313 <i class =" fa-brands fa-linkedin" ></i >
1414 </a >
15- <a href =" https://last.fm/user/djumyeah" target =" _blank" onclick = " window . umami ? . track ( ' lastfm-click ' ) " >
15+ <a href =" https://last.fm/user/djumyeah" target =" _blank" >
1616 <i class =" fa-brands fa-lastfm" ></i >
1717 </a >
18- <a href =" https://letterboxd.com/UmYeah/" target =" _blank" onclick = " window . umami ? . track ( ' letterboxd-click ' ) " >
18+ <a href =" https://letterboxd.com/UmYeah/" target =" _blank" >
1919 <i class =" fa-brands fa-letterboxd" ></i >
2020 </a >
2121 </span >
Original file line number Diff line number Diff line change @@ -20,6 +20,32 @@ const { pageTitle= "UmYeah's Dev" } = Astro.props
2020 { import .meta .env .PROD && (
2121 <script defer src = " https://cloud.umami.is/script.js" data-website-id = " 8f4cf848-6c38-4f28-90a8-b74fc6b923c9" />
2222 )}
23+ <script is:inline >
24+ document.addEventListener('click', function(e) {
25+ const link = e.target.closest('a');
26+ if (!link || !window.umami) return;
27+
28+ const href = link.href;
29+ if (!href) return;
30+
31+ // Check if external link
32+ const isExternal = link.target === '_blank' ||
33+ (link.hostname && link.hostname !== window.location.hostname);
34+
35+ if (!isExternal) return;
36+
37+ // Determine source
38+ let source = 'page';
39+ if (link.closest('footer')) source = 'footer';
40+ else if (link.closest('nav')) source = 'navigation';
41+ else if (link.closest('section') || link.closest('article')) source = 'blog-content';
42+
43+ // Get destination domain
44+ const destination = new URL(href).hostname;
45+
46+ window.umami.track('external-link-click', { source, destination });
47+ });
48+ </script >
2349 <script is:inline src =" https://kit.fontawesome.com/c814bbafd8.js" crossorigin =" anonymous" />
2450 <title >{ pageTitle } </title >
2551 </head >
You can’t perform that action at this time.
0 commit comments