aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2018-11-04 20:43:40 +0100
committerNoah Loomans <noahloomans@gmail.com>2018-11-04 20:43:46 +0100
commitcaeb6bad750ed3d7e26606dca07edc097885d8ce (patch)
tree41f354baece8248eb3d486300379d94efaab532d
parent862f7c21a231f0669fc5d430aec60cea01b499db (diff)
Remove Google Analytics
-rw-r--r--public/javascripts/analytics.js35
-rw-r--r--public/javascripts/main.js4
-rw-r--r--views/layout.jade2
3 files changed, 0 insertions, 41 deletions
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)
})
diff --git a/views/layout.jade b/views/layout.jade
index 31b3918..aea6d5f 100644
--- a/views/layout.jade
+++ b/views/layout.jade
@@ -14,6 +14,4 @@ html(lang='nl')
block head
body(style='opacity: 0;')
block content
- script.
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');ga('create', 'UA-83684754-1', 'auto');ga('send', 'pageview');
block scripts