mounted() {
if (window.isPublished) {
this.conversionTracking = this.$cookies.get('cookies:analytical') == 'true' || this.$cookies.get('cookies:analytical') === null
this.remarketing = this.$cookies.get('cookies:remarketing') == 'true' || this.$cookies.get('cookies:remarketing') == false
}
},
seems to work thought something like https://gist.github.com/jasperf/abf2d4780404ac214cfb6c50ea809725 also seems nice
Works. Also updated code some for accepting all cookies or accepting the ones checked.
acceptSelectedCookies() {
if (window.isPublished) {
if (this.conversionTracking) {
this.$cookies.set('cookies:analytical', this.conversionTracking, '365d')
}
if (this.remarketing) {
this.$cookies.set('cookies:remarketing', this.remarketing, '365d')
}
if (this.cookiesFunctional) {
this.$cookies.set('cookies:accepted', true, '365d')
}
}
EventBus.$emit('closed-cookies-modal')
this.hideCookies()
},
acceptAllCookies() {
if (window.isPublished) {
this.$cookies.set('cookies:analytical', this.conversionTracking, '365d')
this.$cookies.set('cookies:remarketing', this.remarketing, '365d')
this.$cookies.set('cookies:accepted', true, '365d')
}
EventBus.$emit('closed-cookies-modal')
this.hideCookies()
}