From 7340e0df745d2f0ae013f9fd3e1fa5c8530bc189 Mon Sep 17 00:00:00 2001 From: "Matt (IPv4) Cowley" Date: Thu, 17 Dec 2020 15:17:40 +0000 Subject: [PATCH] Add analytics event for langauge selection (#198) * Add analytics event for language * Action per language pack * Missing underscore in action --- src/nginxconfig/templates/app.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/nginxconfig/templates/app.vue b/src/nginxconfig/templates/app.vue index f0383a6..f4b360a 100644 --- a/src/nginxconfig/templates/app.vue +++ b/src/nginxconfig/templates/app.vue @@ -213,6 +213,11 @@ THE SOFTWARE. // Update the locale this.$i18n.locale = data.computed; + + // Analytics + const pack = data.computed.match(/^([a-z]+)([A-Z]*)$/).slice(1) + .map(x => x.toLowerCase()).filter(x => !!x).join('_'); + analytics(`set_language_${pack}`, 'Language'); }, deep: true, },