diff --git a/src/components/DictionaryView.vue b/src/components/DictionaryView.vue index 6b7387eb1be275720c10861c5961ff915581d990..49b5830cd7839a1758481e240beedca1f6b8593a 100644 --- a/src/components/DictionaryView.vue +++ b/src/components/DictionaryView.vue @@ -265,12 +265,6 @@ export default { } }) .then(() => { - self.$plausible.trackEvent('dropdown selection', { - props: { - query: event.q, - match: event.match - } - }) self.waiting_for_articles = false history.replaceState({ article: self.article, @@ -284,18 +278,22 @@ export default { this.article = null this.$router.push(`/${this.lang}/search/${event.q}`) navigate_to_search(this, event.q) - this.$plausible.trackEvent('dropdown selection', { - props: { - query: event.q, - match: '<fritekstsøk>' - } - }) + event.match = '<fritekstsøk>' } + // Tracking + console.log(event.update_lang ? "language" : 'dropdown selection') + this.$plausible.trackEvent(event.update_lang ? "language" : 'dropdown selection', { + props: { + query: event.q, + match: event.match + } + }) }, update_lang_form: function (event) { this.lang = event if (this.event && !this.article) { this.event.articles = null + this.event.update_lang = true this.select_result(this.event) } }, @@ -363,11 +361,6 @@ export default { self.waiting_for_articles = false }) }, - watch: { - $route() { - this.$plausible.trackEvent('language', {props: {code: this.$route.params.lang}}) - } - }, created: function() { let self = this window.onpopstate = function (event) {