Skip to content

Commit a0fc3d2

Browse files
committed
update readme
1 parent 274a664 commit a0fc3d2

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,24 @@ amplitude.init('YOUR_API_KEY_HERE', 'USER_ID_HERE');
5858

5959
# Setting Event Properties #
6060

61-
You can attach additional data to any event by passing a Javascript object as the second argument to `logEvent`:
61+
You can attach additional data to any event by passing a Javascript object as the second argument to `logEvent`. The Javascript object should be in the form of key + value pairs that can be JSON serialized (we recommend using String values):
6262

6363
```javascript
6464
var eventProperties = {};
6565
eventProperties.key = 'value';
6666
amplitude.logEvent('EVENT_IDENTIFIER_HERE', eventProperties);
6767
```
6868

69+
Alternatively, you can set multiple event properties like this:
70+
```javascript
71+
var eventProperties = {
72+
'color': 'blue',
73+
'age': 20,
74+
'key': 'value'
75+
};
76+
amplitude.logEvent('EVENT_IDENTIFIER_HERE', eventProperties);
77+
```
78+
6979
# User Properties and User Property Operations #
7080

7181
The SDK supports the operations `set`, `setOnce`, `unset`, and `add` on individual user properties. The operations are declared via a provided `Identify` interface. Multiple operations can be chained together in a single `Identify` object. The `Identify` object is then passed to the Amplitude client to send to the server. The results of the operations will be visible immediately in the dashboard, and take effect for events logged after.

0 commit comments

Comments
 (0)