Skip to content

Commit 8d1bc72

Browse files
committed
cleaned up readme
1 parent 77d9630 commit 8d1bc72

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,23 +209,25 @@ amplitude.init('YOUR_API_KEY_HERE', null, {
209209

210210

211211
# Advanced #
212-
213212
This SDK automatically grabs useful data about the browser, including browser type and operating system version.
214213

214+
### Setting Version Name ###
215215
By default, no version name is set. You can specify a version name to distinguish between different versions of your site by calling `setVersionName`:
216216

217217
```javascript
218218
amplitude.setVersionName('VERSION_NAME_HERE');
219219
```
220220

221-
User IDs are automatically generated and stored in cookies if not specified.
222-
221+
### Custom Device Ids ###
223222
Device IDs are generated randomly, although you can define a custom device ID setting it as a configuration option or by calling:
224223

225224
```javascript
226225
amplitude.setDeviceId('CUSTOM_DEVICE_ID');
227226
```
228227

228+
**Note: this is not recommended unless you really know what you are doing** (like if you have your own system for tracking user devices). Make sure the deviceId you set is sufficiently unique (we recommend something like a UUID - see `src/uuid.js` for an example of how to generate) to prevent conflicts with other devices in our system.
229+
230+
### Log Event Callbacks and Redirects ###
229231
You can pass a callback function to logEvent, which will get called after receiving a response from the server:
230232

231233
```javascript
@@ -258,7 +260,9 @@ var trackClickLinkA = function() {
258260
});
259261
};
260262
```
261-
You can also pass a callback function to init, which will get called after the SDK finishes its asynchronous loading. Note: no values are passed to the init callback function:
263+
264+
### Init Callbacks ###
265+
You can also pass a callback function to init, which will get called after the SDK finishes its asynchronous loading. *Note: no values are passed to the init callback function*:
262266

263267
```javascript
264268
amplitude.init('YOUR_API_KEY_HERE', 'USER_ID_HERE', null, callback_function);

0 commit comments

Comments
 (0)