You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -16,17 +15,17 @@ If a user returns to your site after the cookie expires, Analytics.js looks for
16
15
17
16
### Cookie Settings
18
17
19
-
Analytics.js sets some default properties when creating cookies for user or group identities. You can override the default cookie properties in code when loading analytics.js by passing in a `cookie` object.
18
+
Analytics.js sets some default properties when creating cookies for user or group identities. You can override the default cookie properties in code when loading Analytics.js by passing in a `cookie` object.
20
19
21
20
Here is the full list of available parameters with their default values:
22
21
23
22
| Parameter | Description | Default value |
24
23
| --- | --- | --- |
25
-
|`domain`| The domain to set the cookie to. Must match the domain of the JavaScript origin. Cookies set on top-level domain are available to sub-domains. | Top-level domain |
24
+
|`domain`| The domain to set the cookie to. This must match the domain of the JavaScript origin. Cookies set on top-level domain are available to sub-domains. | Top-level domain |
26
25
|`maxage`| The maximum amount of time in seconds before the cookie expires. Browsers may clear cookies before this elapses. | 1 year |
27
26
|`path`| The path the cookie is valid for. |`"/"`|
28
-
|`sameSite`|Prevents the browser from sending the cookie along with cross-site requests. | Lax |
29
-
|`secure`|Determines whether cookies can only be transmitted over secure protocols such as https. | false |
27
+
|`sameSite`|This prevents the browser from sending the cookie along with cross-site requests. | Lax |
28
+
|`secure`|This determines whether cookies can only be transmitted over secure protocols such as https. | false |
30
29
31
30
Example:
32
31
```js
@@ -41,18 +40,18 @@ analytics.load('writeKey', {
41
40
})
42
41
```
43
42
44
-
### User Setttings
43
+
### User Settings
45
44
46
-
Analytics.js automatically persists the user's ID and traits locally. You can override how and where the user ID and traits are stored when loading analytics.js by passing in a `user` object.
45
+
Analytics.js automatically persists the user's ID and traits locally. You can override how and where the user ID and traits are stored when loading Analytics.js by passing in a `user` object.
47
46
48
47
The user object has the following fields and default values:
49
48
50
49
| Option | Description | Default value |
51
-
| --- | --- | --- |
52
-
|`persist`|Toggles storing user information locally. | true |
53
-
|`cookie.key`| Name of the cookie used to store the user id. | ajs_user_id |
54
-
|`cookie.oldKey`| Name of a cookie previously used to store the user id. Will be read if `cookie.key`cannot be found. | ajs_user |
55
-
|`localStorage.key`| Name of the key used to store user traits in LocalStorage. | ajs_user_traits |
50
+
| ------| -----------|------------- |
51
+
|`persist`|This toggles storing user information locally. |`true`|
52
+
|`cookie.key`| Name of the cookie used to store the user ID. |`ajs_user_id`|
53
+
|`cookie.oldKey`| Name of a cookie previously used to store the user ID. Will be read if `cookie.key`can't be found. |`ajs_user`|
54
+
|`localStorage.key`| Name of the key used to store user traits in LocalStorage. |`ajs_user_traits`|
56
55
57
56
Example:
58
57
```js
@@ -69,17 +68,17 @@ analytics.load('writeKey', {
69
68
})
70
69
```
71
70
72
-
### Group Setttings
71
+
### Group Settings
73
72
74
73
Analytics.js automatically persists the user's group ID and group properties locally. You can override how and where the group ID and properties are stored when loading analytics.js by passing in a `group` object.
75
74
76
75
The group object has the following fields and default values:
77
76
78
77
| Field | Description | Default value |
79
-
| --- | --- | --- |
80
-
|`persist`| Toggles storing group information locally. | true |
81
-
|`cookie.key`| Name of the cookie used to store the group id. | ajs_group_id |
82
-
|`localStorage.key`| Name of the key used to store user traits in LocalStorage. | ajs_group_properties |
78
+
| -----| -----------|------------- |
79
+
|`persist`| Toggles storing group information locally. |`true`|
80
+
|`cookie.key`| Name of the cookie used to store the group id. |`ajs_group_id`|
81
+
|`localStorage.key`| Name of the key used to store user traits in LocalStorage. |`ajs_group_properties`|
83
82
84
83
Example:
85
84
```js
@@ -98,14 +97,14 @@ analytics.load('writeKey', {
98
97
99
98
## Persistent Retries
100
99
101
-
When enabled, Analytics.js automatically retries network and server errors. When the client is offline or your application can't connect to Segment's API, analytics.js stores events in `localStorage` and falls back to in-memory storage when `localStorage` is unavailable.
100
+
When enabled, Analytics.js automatically retries network and server errors. When the client is offline or your application can't connect to Segment's API, Analytics.js stores events in `localStorage` and falls back to in-memory storage when `localStorage` is unavailable.
102
101
103
102
## Disable All Client-Side Persistence
104
103
105
104
<!-- TODO: Mention GDPR and/or regulations as a reason to do this? -->
106
105
Analytics.js supports disabling persisting any data locally. This will force analytics.js to store data in-memory only and disables automatic identity tracking across pages.
107
106
108
-
You can completely disable client-side persistence when loading analytics.js by setting `disableClientPersistence` to `true`.
107
+
You can completely disable client-side persistence when loading Analytics.js by setting `disableClientPersistence` to `true`.
0 commit comments