-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata-collection.wit
114 lines (100 loc) · 2.61 KB
/
data-collection.wit
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
package edgee:components;
interface data-collection {
type dict = list<tuple<string,string>>;
enum event-type { page, track, user }
enum consent { pending, granted, denied }
record event {
uuid: string,
timestamp: s64,
timestamp-millis: s64,
timestamp-micros: s64,
event-type: event-type,
data: data,
context: context,
consent: option<consent>,
}
variant data {
page(page-data),
track(track-data),
user(user-data),
}
record page-data {
name: string,
category: string,
keywords: list<string>,
title: string,
url: string,
path: string,
search: string,
referrer: string,
properties: dict,
}
record user-data {
user-id: string,
anonymous-id: string,
edgee-id: string,
properties: dict,
}
record track-data {
name: string,
properties: dict,
products: list<dict>,
}
record context {
page: page-data,
user: user-data,
client: client,
campaign: campaign,
session: session,
}
record client {
ip: string,
locale: string,
timezone: string,
user-agent: string,
user-agent-architecture: string,
user-agent-bitness: string,
user-agent-version-list: string,
user-agent-full-version-list: string,
user-agent-mobile: string,
user-agent-model: string,
os-name: string,
os-version: string,
screen-width: s32,
screen-height: s32,
screen-density: f32,
continent: string,
country-code: string,
country-name: string,
region: string,
city: string,
}
record campaign {
name: string,
source: string,
medium: string,
term: string,
content: string,
creative-format: string,
marketing-tactic: string,
}
record session {
session-id: string,
previous-session-id: string,
session-count: u32,
session-start: bool,
first-seen: s64,
last-seen: s64,
}
record edgee-request {
method: http-method,
url: string,
headers: dict,
forward-client-headers: bool,
body: string,
}
enum http-method { GET, PUT, POST, DELETE }
page: func(e: event, settings: dict) -> result<edgee-request, string>;
track: func(e: event, settings: dict) -> result<edgee-request, string>;
user: func(e: event, settings:dict) -> result<edgee-request, string>;
}