From 3fb86482404e11942cd83c3500a297a3991db0e4 Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Wed, 13 Sep 2017 16:28:53 +0200 Subject: Restructure project --- public/javascripts/analytics.js | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 public/javascripts/analytics.js (limited to 'public/javascripts/analytics.js') 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 -- cgit v1.1