-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathevent-handler.js
More file actions
35 lines (31 loc) · 1.24 KB
/
event-handler.js
File metadata and controls
35 lines (31 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
A non-ecommerce event has the following schema:
{
DeviceId: "a80eea1c-57f5-4f84-815e-06fe971b6ef2",
EventAttributes: {test: "Error", t: 'stack trace in string form'},
EventName: "Error",
MPID: "123123123123",
UserAttributes: {userAttr1: 'value1', userAttr2: 'value2'},
UserIdentities: [{Identity: 'email@gmail.com', Type: 7}]
User Identity Types can be found here:
}
*/
function EventHandler(common) {
this.common = common || {};
}
EventHandler.prototype.logEvent = function (_event) {};
EventHandler.prototype.logError = function (_event) {
// The schema for a logError event is the same, but noteworthy differences are as follows:
// {
// EventAttributes: {m: 'name of error passed into MP', s: "Error", t: 'stack trace in string form if applicable'},
// EventName: "Error"
// }
};
EventHandler.prototype.logPageView = function (_event) {
/* The schema for a logPagView event is the same, but noteworthy differences are as follows:
{
EventAttributes: {hostname: "www.google.com", title: 'Test Page'}, // These are event attributes only if no additional event attributes are explicitly provided to mParticle.logPageView(...)
}
*/
};
module.exports = EventHandler;