mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-08-02 02:38:53 -04:00
12 lines
315 B
TypeScript
12 lines
315 B
TypeScript
import { fromEvent } from "rxjs"
|
|
|
|
// Track click events
|
|
fromEvent(document.body, "click")
|
|
.subscribe(ev => {
|
|
if (ev.target instanceof HTMLElement) {
|
|
var el = ev.target.closest("a[href^=http]")
|
|
if (el instanceof HTMLLinkElement)
|
|
ga("send", "event", "outbound", "click", el.href)
|
|
}
|
|
})
|