2022-09-20 19:59:52 +00:00
|
|
|
<template />
|
|
|
|
|
|
|
|
<script>
|
2023-12-01 17:57:14 +00:00
|
|
|
import { computed } from 'vue'
|
|
|
|
import { useAuthStore } from '../../stores/auth'
|
2022-09-20 19:59:52 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'Hotjar',
|
|
|
|
|
2023-12-01 17:57:14 +00:00
|
|
|
setup () {
|
|
|
|
const authStore = useAuthStore()
|
|
|
|
return {
|
|
|
|
authenticated : computed(() => authStore.check),
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2022-09-20 19:59:52 +00:00
|
|
|
watch: {
|
|
|
|
authenticated () {
|
|
|
|
if (this.authenticated) {
|
|
|
|
this.loadHotjar()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted () {
|
|
|
|
this.loadHotjar()
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
loadHotjar () {
|
|
|
|
if (!this.authenticated || this.isIframe) return
|
|
|
|
|
|
|
|
(function (h, o, t, j, a, r) {
|
|
|
|
h.hj = h.hj || function () {
|
|
|
|
(h.hj.q = h.hj.q || []).push(arguments)
|
|
|
|
}
|
|
|
|
h._hjSettings = { hjid: 2449591, hjsv: 6 }
|
|
|
|
a = o.getElementsByTagName('head')[0]
|
|
|
|
r = o.createElement('script')
|
|
|
|
r.async = 1
|
|
|
|
r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv
|
|
|
|
a.appendChild(r)
|
|
|
|
})(window, document, 'https://static.hotjar.com/c/hotjar-', '.js?sv=')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
isIframe () {
|
|
|
|
return window.location !== window.parent.location || window.frameElement
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|