2021-05-28 10:19:13 -07:00
|
|
|
export default function (context) {
|
2022-05-15 17:54:59 -07:00
|
|
|
// Temporary disable analytics
|
|
|
|
|
/*
|
2022-03-07 19:01:38 -07:00
|
|
|
if (process.client && context.from.path === context.route.path) {
|
2021-05-28 10:19:13 -07:00
|
|
|
return
|
|
|
|
|
}
|
2022-03-07 19:01:38 -07:00
|
|
|
|
|
|
|
|
if (context.$config.analytics.base_url == null) {
|
|
|
|
|
return
|
2021-05-18 16:48:26 +02:00
|
|
|
}
|
2022-03-07 19:01:38 -07:00
|
|
|
|
2021-05-28 10:19:13 -07:00
|
|
|
setTimeout(() => {
|
2022-03-07 19:01:38 -07:00
|
|
|
context.$axios
|
|
|
|
|
.post(`${context.$config.analytics.base_url}/register/visit`, {
|
|
|
|
|
path: context.route.path,
|
|
|
|
|
domain: process.server ? context.req.headers.host : location.host,
|
2021-05-28 10:19:13 -07:00
|
|
|
consent: false,
|
|
|
|
|
})
|
|
|
|
|
.then(() => {})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
console.error('An error occurred while registering the visit: ', e)
|
|
|
|
|
})
|
|
|
|
|
})
|
2022-05-15 17:54:59 -07:00
|
|
|
*/
|
2021-05-18 16:48:26 +02:00
|
|
|
}
|