Skip to content

Commit 8feb2d1

Browse files
committed
Add Analytics.js Subdomain Cookie Info DOC-582
1 parent ff57fe9 commit 8feb2d1

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/_data/sidenav/strat.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ sections:
9797
section_title: Analytics.js Documentation
9898
section:
9999
- path: /connections/sources/catalog/libraries/website/javascript
100-
title: Analytics.js (Javascript) Source
100+
title: Analytics.js (JavaScript) Source
101101
- path: /connections/sources/catalog/libraries/website/javascript/ajs-classic
102102
title: Analytics.js Classic
103103
- path: /connections/sources/catalog/libraries/website/javascript/upgrade-to-ajs2

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ strat: ajs
55

66
This page explains what data Analytics.js stores on the client and how to override and change what and how this data is stored.
77

8-
## Segment ID Persistence
8+
## Segment ID persistence
99

1010
<!-- Note: 1st 2 paragraphs copied from identity.md -->
1111

12-
To ensure high fidelity, first-party customer data, Segment writes the user's IDs to the user's local storage, and uses that as the Segment ID on the cookie whenever possible. Local storage is for storing this type of first-party customer information.
12+
To ensure high fidelity, first-party customer data, Segment writes the user's IDs to the user's local storage and uses that as the Segment ID on the cookie whenever possible. Local storage is for storing this type of first-party customer information.
1313

1414
If a user returns to your site after the cookie expires, Analytics.js looks for an old ID in the user's `localStorage`, and if one is found, it sets as the user's ID again in the new cookie. If a user clears their cookies _and_ `localStorage`, all of the IDs are removed, and the user gets a completely new [`anonymousID`](/docs/connections/sources/catalog/libraries/website/javascript/identity/#anonymous-ids) when they next visit the page.
1515

16-
### Cookie Settings
16+
### Cookie settings
1717

1818
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 to the load method.
1919

2020
Here is the full list of available parameters with their default values:
2121

2222
| Parameter | Description | Default value |
2323
| --- | --- | --- |
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 |
24+
| `domain` | The domain to set the cookie to. This must match the domain of the JavaScript origin. If an Analytics.js cookie already exists at the top-level domain, Segment carries the same cookie value to any subdomains, despite `domain` configuration. | Top-level domain |
2525
| `maxage` | The maximum amount of time in seconds before the cookie expires. Browsers may clear cookies before this elapses. | 1 year |
2626
| `path` | The path the cookie is valid for. | `"/"` |
2727
| `sameSite` | This prevents the browser from sending the cookie along with cross-site requests. | `Lax` |
@@ -40,7 +40,7 @@ analytics.load('writeKey', {
4040
})
4141
```
4242

43-
### User Settings
43+
### User settings
4444

4545
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 to the load method.
4646

@@ -68,7 +68,7 @@ analytics.load('writeKey', {
6868
})
6969
```
7070

71-
### Group Settings
71+
### Group settings
7272

7373
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 to the load method.
7474

@@ -95,11 +95,11 @@ analytics.load('writeKey', {
9595
})
9696
```
9797

98-
## Persistent Retries
98+
## Persistent retries
9999

100100
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.
101101

102-
## Disable All Client-Side Persistence
102+
## Disable all client-side persistence
103103

104104
<!-- TODO: Mention GDPR and/or regulations as a reason to do this? -->
105105
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.
@@ -114,9 +114,9 @@ analytics.load('writeKey', { disableClientPersistence: true })
114114

115115
When `disableClientPersistence` is set to `true`, Analytics.js won't be able to automatically keep track of a user's identity when navigating to different pages. This can cause increased MTU usage if the anonymous usage can't be associated with a `userId`.
116116

117-
You can still manually track identity by calling `analytics.identify()` with the known identity on each page load, or you can pass in identity information to each page using the [querystring API](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/querystring/).
117+
You can still manually track identity by calling `analytics.identify()` with the known identity on each page load, or you can pass in identity information to each page using the [querystring API](/docs/connections/sources/catalog/libraries/website/javascript/querystring/).
118118

119-
### Event Retries
119+
### Event retries
120120

121121
Analytics.js tries to detect when a page is about to be closed and saves pending events to `localStorage`. When the user navigates to another page within the same domain, Analytics.js attempts to send any events it finds in localStorage.
122122

0 commit comments

Comments
 (0)