From caeb6bad750ed3d7e26606dca07edc097885d8ce Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Sun, 4 Nov 2018 20:43:40 +0100 Subject: Remove Google Analytics --- public/javascripts/analytics.js | 35 ----------------------------------- public/javascripts/main.js | 4 ---- 2 files changed, 39 deletions(-) delete mode 100644 public/javascripts/analytics.js (limited to 'public/javascripts') diff --git a/public/javascripts/analytics.js b/public/javascripts/analytics.js deleted file mode 100644 index a93c8a4..0000000 --- a/public/javascripts/analytics.js +++ /dev/null @@ -1,35 +0,0 @@ -/* global ga */ - -const self = {} - -self.send = {} - -self.send.search = function (selectedUser, favorite) { - const hitType = 'event' - - const eventCategory = favorite ? 'search fav' : 'search' - - let eventAction - switch (selectedUser.type) { - case 'c': - eventAction = 'Class' - break - case 't': - eventAction = 'Teacher' - break - case 'r': - eventAction = 'Room' - break - case 's': - eventAction = 'Student' - break - } - - const eventLabel = selectedUser.value - - ga(function () { - ga('send', { hitType, eventCategory, eventAction, eventLabel }) - }) -} - -module.exports = self diff --git a/public/javascripts/main.js b/public/javascripts/main.js index 6f99621..b3533d2 100644 --- a/public/javascripts/main.js +++ b/public/javascripts/main.js @@ -6,7 +6,6 @@ const schedule = require('./schedule') const weekSelector = require('./weekSelector') const favorite = require('./favorite') const scrollSnap = require('./scrollSnap') -const analytics = require('./analytics') const state = {} @@ -20,7 +19,6 @@ scrollSnap.startListening() if (favorite.get() != null) { state.selectedItem = favorite.get() favorite.update(state.selectedItem) - analytics.send.search(state.selectedItem, true) schedule.viewItem(weekSelector.getSelectedWeek(), state.selectedItem) } else { search.focus() @@ -29,12 +27,10 @@ if (favorite.get() != null) { search.on('search', function (selectedItem) { state.selectedItem = selectedItem favorite.update(state.selectedItem) - analytics.send.search(state.selectedItem) schedule.viewItem(weekSelector.getSelectedWeek(), state.selectedItem) }) weekSelector.on('weekChanged', function (newWeek) { - analytics.send.search(state.selectedItem) schedule.viewItem(newWeek, state.selectedItem) }) -- cgit v1.1