From 2dce7a956ffd4ce97ec2c4497f4604abedea1cc9 Mon Sep 17 00:00:00 2001 From: MattIPv4 Date: Fri, 17 Jul 2020 16:25:00 +0100 Subject: [PATCH] Only use analytics.js, not gtag.js --- src/nginxconfig/templates/app.vue | 6 +++--- src/nginxconfig/util/analytics.js | 17 +++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/nginxconfig/templates/app.vue b/src/nginxconfig/templates/app.vue index ad497f3..1d3465c 100644 --- a/src/nginxconfig/templates/app.vue +++ b/src/nginxconfig/templates/app.vue @@ -167,7 +167,7 @@ THE SOFTWARE. importData(query, this.$data.domains, this.$data.global, this.$nextTick); // Send an initial GA event for column mode - this.splitColumnEvent(); + this.splitColumnEvent(true); }, methods: { changes(index) { @@ -261,8 +261,8 @@ THE SOFTWARE. this.$data.splitColumn = !this.$data.splitColumn; this.splitColumnEvent(); }, - splitColumnEvent() { - analytics('toggle_split_column', 'Button', undefined, Number(this.$data.splitColumn)); + splitColumnEvent(nonInteraction = false) { + analytics('toggle_split_column', 'Button', undefined, Number(this.$data.splitColumn), nonInteraction); }, }, }; diff --git a/src/nginxconfig/util/analytics.js b/src/nginxconfig/util/analytics.js index 68c5262..b930c52 100644 --- a/src/nginxconfig/util/analytics.js +++ b/src/nginxconfig/util/analytics.js @@ -24,16 +24,16 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -export default (action, category, label, value) => { +export default (action, category, label, value, nonInteraction = false) => { try { // gtag.js - if (window.gtag) { - return window.gtag('event', action, { - event_category: category, - event_label: label, - value, - }); - } + // if (window.gtag) { + // return window.gtag('event', action, { + // event_category: category, + // event_label: label, + // value, + // }); + // } // analytics.js if (window.ga) { @@ -43,6 +43,7 @@ export default (action, category, label, value) => { eventAction: action, eventLabel: label, eventValue: value, + nonInteraction, }); } } catch (_) {