diff --git a/src/App.vue b/src/App.vue index 4695fe2dde8b7d8c1c0fc9087c541031f2574a1b..24f29b59d6145464cd674a39562ed0c197a15f63 100644 --- a/src/App.vue +++ b/src/App.vue @@ -75,7 +75,11 @@ window.onpopstate = function (event) { } } -function navigate_to_article(self, article_id) { +function navigate_to_article(self, article_id, origin_article, origin_lemma) { + if (origin_article) { + self.$plausible.trackEvent('internal link incoming', {props: {origin: `${self.$route.params.lang}/${origin_article}/${origin_lemma || '_'}`}}) + } + axios.get(self.api_pref + '' + article_id) .then(function(response){ self.article = response.data @@ -171,9 +175,11 @@ export default { this.article_key++ history.replaceState({article: this.article, search_results: this.search_results, lang: this.lang}, '') }else{ + let current_art_id = this.article.article_id + let current_lemma = this.article.lemmas[0].lemma this.article = {lemmas: [], body:{pronunciation: [], definitions: [], etymology: []}} this.waiting_for_articles = true - navigate_to_article(this, item.article_id) + navigate_to_article(this, item.article_id, current_art_id, current_lemma) } }, search_hit_click: function(article){