Skip to content

Commit c05ec9c

Browse files
committed
[netlify-build]
1 parent 363749b commit c05ec9c

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

src/_data/sidenav/strat.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ sections:
110110
title: Quickstart tutorial
111111
- path: /connections/sources/catalog/libraries/website/javascript/custom-proxy
112112
title: Custom proxy for Analytics.js
113+
- path: /connections/sources/catalog/libraries/website/javascript/persistence
114+
title: Client-side persistence in Analytics.js
113115
- path: /connections/sources/catalog/libraries/website/javascript/identity
114116
title: Managing identity in Analytics.js
115117
- path: /connections/sources/catalog/libraries/website/javascript/middleware

src/connections/sources/catalog/libraries/website/javascript/persistence.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: Managing Analytics.js client-side persistence
3-
hidden: true
43
strat: ajs
54
---
65

@@ -16,17 +15,17 @@ If a user returns to your site after the cookie expires, Analytics.js looks for
1615

1716
### Cookie Settings
1817

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.
2019

2120
Here is the full list of available parameters with their default values:
2221

2322
| Parameter | Description | Default value |
2423
| --- | --- | --- |
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 |
2625
| `maxage` | The maximum amount of time in seconds before the cookie expires. Browsers may clear cookies before this elapses. | 1 year |
2726
| `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 |
3029

3130
Example:
3231
```js
@@ -41,18 +40,18 @@ analytics.load('writeKey', {
4140
})
4241
```
4342

44-
### User Setttings
43+
### User Settings
4544

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.
4746

4847
The user object has the following fields and default values:
4948

5049
| 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` |
5655

5756
Example:
5857
```js
@@ -69,17 +68,17 @@ analytics.load('writeKey', {
6968
})
7069
```
7170

72-
### Group Setttings
71+
### Group Settings
7372

7473
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.
7574

7675
The group object has the following fields and default values:
7776

7877
| 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` |
8382

8483
Example:
8584
```js
@@ -98,14 +97,14 @@ analytics.load('writeKey', {
9897

9998
## Persistent Retries
10099

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.
102101

103102
## Disable All Client-Side Persistence
104103

105104
<!-- TODO: Mention GDPR and/or regulations as a reason to do this? -->
106105
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.
107106

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`.
109108

110109
```js
111110
analytics.load('writeKey', { disableClientPersistence: true })

0 commit comments

Comments
 (0)