Re-add custom page_view event
Some checks are pending
Deploy to GitHub Pages / build (push) Waiting to run
Deploy to GitHub Pages / deploy (push) Blocked by required conditions

This commit is contained in:
Misode
2025-01-04 20:42:04 +01:00
parent e52e6a791c
commit a97c21d9de
4 changed files with 19 additions and 2 deletions

View File

@@ -4,6 +4,13 @@ import type { VersionId } from './services/index.js'
export type Method = 'menu' | 'hotkey'
export namespace Analytics {
export function pageview(url: string) {
gtag('event', 'page_view', {
page_location: url,
page_title: document.title,
})
}
export function setLocale(locale: string) {
gtag('set', {
locale,