Skip to content

Commit b469c06

Browse files
author
Todd Bodnar
committed
user javascript docs
1 parent 5dadf45 commit b469c06

File tree

2 files changed

+118
-1
lines changed

2 files changed

+118
-1
lines changed

documentation/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ This documentation is organized as following:
116116

117117
**Parameters**:
118118

119-
{object} **user**: A plain object specifying the user information the activity belongs to. More information about the structure can be found [here](TODO).
119+
{object} **user**: A plain object specifying the user information the activity belongs to. More information about the structure can be found [here](./user.md).
120120

121121
{string|null} **type**: The type of the activity collected, i.e., one of *search*, *login*, *logout*, *addToCart*, *removeFromCart*, *checkOut*, *selectProduct*, or *other*. If not specified, the default *other* will be used.
122122

documentation/user.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
## User Field Documentation
2+
3+
Breinify supports various user properties that you can include in the analytics.
4+
5+
### Example of full user info
6+
7+
```javascript
8+
var user = {
9+
'EMAIL':'johndoe@gmail.com',
10+
'FIRSTNAME':'John',
11+
'LASTNAME':'Doe',
12+
'DATEOFBIRTH': new Date(1985,6,30),
13+
'DEVICEID' : 'AAAAAAAAA-BBBB-CCCC-1111-222222220000',
14+
'MD5EMAIL' : '761cd16b141770ecb0bbb8a4e5962d16',
15+
'SESSIONID' : 'SID:ANON:w3.org:j6oAOxCWZ'
16+
}
17+
```
18+
19+
### Fields
20+
21+
#### Email
22+
23+
Attribute key: `EMAIL`
24+
25+
Example value: `johndoe@gmail.com`
26+
27+
Description: The email address of the current user, if known.
28+
29+
#### First Name
30+
31+
Attribute key: `FIRSTNAME`
32+
33+
Example value: `John`
34+
35+
Description: The first name of the current user, if known.
36+
37+
#### Last Name
38+
39+
Attribute String: `LASTNAME`
40+
41+
Example: `Doe`
42+
43+
Description: The last name of the current user, if known.
44+
45+
#### Date of Birth
46+
47+
Attribute key: `DATEOFBIRTH`
48+
49+
Example value: `new Date(1985, 6, 30)`
50+
51+
Description: The email address of the current user, if known.
52+
53+
#### Device ID
54+
55+
Attribute key: `DEVICEID`
56+
57+
Example value: `AAAAAAAAA-BBBB-CCCC-1111-222222220000`
58+
59+
Description: The current user's device's id, if known.
60+
61+
#### MD5 Email
62+
63+
Attribute key: `MD5EMAIL`
64+
65+
Example value: `761cd16b141770ecb0bbb8a4e5962d16`
66+
67+
Description: A hashed version of the user's email address.
68+
69+
70+
#### Session ID
71+
72+
Attribute key: `SESSIONID`
73+
74+
Example value: `SID:ANON:w3.org:j6oAOxCWZ`
75+
76+
Description: The user's [Session Id](https://en.wikipedia.org/wiki/Session_ID).
77+
78+
79+
80+
/*
81+
* Overview of all the different properties available for a user.
82+
*/
83+
attributes.add('EMAIL', {
84+
name: 'email',
85+
group: 1,
86+
optional: false
87+
});
88+
attributes.add('FIRSTNAME', {
89+
name: 'firstName',
90+
group: 2,
91+
optional: false
92+
});
93+
attributes.add('LASTNAME', {
94+
name: 'lastName',
95+
group: 2,
96+
optional: false
97+
});
98+
attributes.add('DATEOFBIRTH', {
99+
name: 'dateOfBirth',
100+
group: 2,
101+
optional: false
102+
});
103+
attributes.add('DEVICEID', {
104+
name: 'deviceId',
105+
group: 3,
106+
optional: false
107+
});
108+
attributes.add('MD5EMAIL', {
109+
name: 'md5Email',
110+
group: 4,
111+
optional: false
112+
});
113+
attributes.add('SESSIONID', {
114+
name: 'sessionId',
115+
group: 5,
116+
optional: false
117+
});

0 commit comments

Comments
 (0)