Skip to content

Commit d34b517

Browse files
committed
add umami outbound links analytics
1 parent 2fd004f commit d34b517

File tree

3 files changed

+6
-30
lines changed

3 files changed

+6
-30
lines changed

src/lib/components/Link.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@
2222
</script>
2323

2424
{#if isButton}
25-
<a {href} target={isNewTab ? "_blank" : "_self"}>
25+
<a
26+
{href}
27+
target={isNewTab ? "_blank" : "_self"}
28+
data-umami-event={isNewTab ? "outbound-link-click" : undefined}
29+
data-umami-event-url={isNewTab ? href : undefined}
30+
>
2631
<RippleButton rippleColor="#66A29E" duration="1500ms" {theme}>
2732
<div
2833
class="group inline-flex items-center justify-center px-1 py-1 transition ease-out hover:duration-300"

src/routes/+layout.svelte

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@
66

77
<!-- Setup Privacy-preserving Umami Analytics -->
88
<svelte:head>
9-
<!-- Umami base script -->
109
<script
1110
async
1211
defer
1312
data-website-id="2d656c7d-b41a-4e19-934c-d7c9d91d784d"
1413
src="https://analytics.server.orcfax.io/umami.js"
1514
></script>
16-
<!-- Outbound-link helper -->
17-
<script async defer src="/track-external.js"></script>
1815
</svelte:head>
1916

2017
{@render children()}

static/track-external.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)