Skip to content

Commit 3a28479

Browse files
committed
removed dead code (tracking & analytics)
1 parent 3b9a2b7 commit 3a28479

2 files changed

Lines changed: 1 addition & 70 deletions

File tree

vis/js/headstart.js

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -32,68 +32,6 @@ HeadstartFSM.prototype = {
3232
}
3333
},
3434

35-
// TODO delete this completely
36-
recordAction: function(id, category, action, user, timestamp, additional_params, post_data) {
37-
38-
if(!config.is_evaluation) {
39-
return;
40-
}
41-
42-
let services = config.evaluation_service;
43-
44-
if(typeof services === "string") {
45-
services = [services];
46-
}
47-
48-
if (services.includes("log")) {
49-
this.recordActionLog(category, action, id, user, timestamp, additional_params, post_data);
50-
}
51-
if (services.includes("ga")) {
52-
this.recordActionGA(category, action, id, user, timestamp, additional_params, post_data);
53-
}
54-
},
55-
56-
recordActionLog: function(id, category, action, user, type, timestamp, additional_params, post_data) {
57-
timestamp = (typeof timestamp !== 'undefined') ? (escape(timestamp)) : ("");
58-
additional_params = (typeof additional_params !== 'undefined') ? ('&' + additional_params) : ("");
59-
if(typeof post_data !== 'undefined') {
60-
post_data = {post_data:post_data};
61-
} else {
62-
post_data = {};
63-
}
64-
65-
let php_script = config.server_url + "services/writeActionToLog.php";
66-
67-
$.ajax({
68-
url: php_script +
69-
'?user=' + user +
70-
'&category=' + category +
71-
'&action=' + action +
72-
'&item=' + encodeURI(id) +
73-
'&type=' + type +
74-
'&item_timestamp=' + timestamp + additional_params + '&jsoncallback=?',
75-
type: "POST",
76-
data: post_data,
77-
dataType: "json",
78-
success: function(output) {
79-
console.log(output);
80-
}
81-
});
82-
},
83-
84-
recordActionGA: function(category, action, id) {
85-
//gtag.js
86-
if(typeof gtag === "function") {
87-
gtag('event', action, {
88-
'event_category': category,
89-
'event_label': id
90-
});
91-
//analytics.js
92-
} else if (typeof ga === "function") {
93-
ga('send', 'event', category, action, id);
94-
}
95-
},
96-
9735
markProjectChanged: function (id) {
9836

9937
let php_script = config.server_url + "services/markProjectChanged.php";

vis/js/mediator.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var MyMediator = function() {
3232
this.fileData = [];
3333
this.mediator = new Mediator();
3434
this.manager = new ModuleManager();
35-
this.intermediate_layer = new Intermediate(this.rescale_map, this.record_action);
35+
this.intermediate_layer = new Intermediate(this.rescale_map);
3636
this.init();
3737
this.init_state();
3838
};
@@ -55,9 +55,6 @@ MyMediator.prototype = {
5555

5656
// bubbles events
5757
this.mediator.subscribe("bubbles_update_data_and_areas", this.bubbles_update_data_and_areas);
58-
59-
// misc
60-
this.mediator.subscribe("record_action", this.record_action);
6158
},
6259

6360
init_state: function() {
@@ -151,10 +148,6 @@ MyMediator.prototype = {
151148
mediator.render_frontend();
152149
},
153150

154-
record_action: function(id, category, action, user, type, timestamp, additional_params, post_data) {
155-
window.headstartInstance.recordAction(id, category, action, user, type, timestamp, additional_params, post_data);
156-
},
157-
158151
dimensions_update: function() {
159152
mediator.intermediate_layer.updateDimensions(config, io.context);
160153
},

0 commit comments

Comments
 (0)