forked from coracle/flotilla
Move error tracking and analytics to their own files
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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})
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user