2024-10-31 19:24:40 +00:00
|
|
|
/* eslint prefer-rest-params: 0 */
|
|
|
|
|
|
2024-10-25 21:36:33 +00:00
|
|
|
import {page} from "$app/stores"
|
|
|
|
|
|
|
|
|
|
const w = window as any
|
|
|
|
|
|
|
|
|
|
w.plausible =
|
|
|
|
|
w.plausible ||
|
|
|
|
|
function () {
|
|
|
|
|
;(w.plausible.q = w.plausible.q || []).push(arguments)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const setupAnalytics = () => {
|
|
|
|
|
page.subscribe($page => {
|
|
|
|
|
if ($page.route) {
|
|
|
|
|
w.plausible("pageview", {u: $page.route.id})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|