switched to cookieless tracking
All checks were successful
CSGOWTF/csgowtf/pipeline/head This commit looks good

This commit is contained in:
2022-12-07 06:50:03 +01:00
parent 78da0877c7
commit 2a541196a4
3 changed files with 2 additions and 76 deletions

View File

@@ -15,14 +15,13 @@
</template>
<script>
import CookieConsentBtn from "@/components/CookieConsentBtn";
import {onMounted, ref} from "vue";
import InfoModal from "@/components/InfoModal";
import CompFooter from "@/components/CompFooter";
import CompNav from "@/components/CompNav";
export default {
components: {CompNav, CompFooter, InfoModal, CookieConsentBtn},
components: {CompNav, CompFooter, InfoModal},
setup() {
const offset = ref(0)

View File

@@ -1,74 +0,0 @@
<template>
<div v-if="!consent" class="card text-end bg-secondary text-white border border-1">
<div class="card-body">
<form class="mb-1">
<div class="form-check">
<input id="essential-cookies" checked class="form-check-input" disabled type="checkbox" value="">
<label class="form-check-label" for="essential-cookies">
Essential
</label>
</div>
<div class="form-check">
<input id="tracking" v-model="tracking" class="form-check-input" type="checkbox">
<label class="form-check-label" for="tracking">
Matomo
</label>
</div>
</form>
<a href="/privacy-policy" class="text-muted">Privacy Policy</a>
<div class="d-flex justify-content-between mt-2">
<button class="btn btn-outline-primary" type="button" @click="handleConsentForget">Decline</button>
<button class="btn btn-info" type="button" @click="handleConsent">Accept</button>
</div>
</div>
</div>
</template>
<script>
import {onMounted, ref} from "vue";
import {useCookies} from 'vue3-cookies'
export default {
name: "CookieConsentBtn",
setup() {
const tracking = ref(true)
const {cookies} = useCookies()
const consent = ref(false)
const handleConsent = () => {
window._paq.push(['rememberCookieConsentGiven'])
cookies.set('consent', 'given', Infinity)
if (tracking.value){
window._paq.push(['rememberConsentGiven'])
}
consent.value = true
}
const handleConsentForget = () => {
consent.value = true
}
onMounted(() => {
window._paq.push(['requireCookieConsent']);
window._paq.push(['trackPageView']);
if (cookies.get('consent') === 'given')
consent.value = true
})
return {handleConsent, handleConsentForget, tracking, consent}
}
}
</script>
<style scoped>
.card {
z-index: 10;
}
form {
display: flex;
gap: 1rem;
}
</style>

View File

@@ -17,6 +17,7 @@ if (process.env.VUE_APP_TRACKING) {
host: process.env.VUE_APP_TRACK_URL,
siteId: process.env.VUE_APP_TRACK_ID,
router: router,
disableCookies: true,
}
)
}