Skip to content

Commit 98c976f

Browse files
committed
JetSnack: track clicks on external links
1 parent b275d69 commit 98c976f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

wasm/jetsnack/index.html

+8
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,14 @@
175175
</script>
176176

177177
<!-- Track visits with respect to privacy -->
178+
<script type="application/javascript" >
179+
document.querySelectorAll("a[target=_blank]").forEach((e) => {
180+
e.setAttribute("data-goatcounter-click", e.href)
181+
e.setAttribute("data-goatcounter-referrer", window.location.pathname)
182+
// data-goatcounter-title
183+
})
184+
</script>
185+
178186
<script data-goatcounter="https://zalim.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
179187
<noscript><img src="https://zalim.goatcounter.com/count?p=wasm/jetsnack/"></noscript>
180188

0 commit comments

Comments
 (0)