Skip to content

Commit 1269b6c

Browse files
authored
Merge pull request #4232 from segmentio/joeynmq-patch-3
Add info for cookies that set by Analytics.js
2 parents 3da36a7 + 6dedaf0 commit 1269b6c

File tree

1 file changed

+23
-2
lines changed
  • src/connections/sources/catalog/libraries/website/javascript

1 file changed

+23
-2
lines changed

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

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,10 +791,10 @@ Segment loads the libraries required for your **enabled** Destinations. When you
791791

792792
Using Analytics.js doesn't offer a large performance benefit, but is more performant than installing each of the destinations individually. And as more destinations move to accept data directly from Segment, you'll receive more performance benefits automatically.
793793

794-
One option, if you don't want to use any bundled third-party tools, is to use the [Analytics-Node](https://github.com/segmentio/analytics-node) package.
794+
One option, if you don't want to use any bundled third-party tools, is to use the [Analytics-Node](https://github.com/segmentio/analytics-node) package.
795795

796796
> info ""
797-
> Analytics.js doesn't set third-party cookies and only sets first-party cookies.
797+
> Analytics.js doesn't set third-party cookies and only sets first-party cookies.
798798
799799
### Bundle size
800800

@@ -804,6 +804,27 @@ The snippet asynchronously requests and loads a customized JavaScript bundle (`a
804804

805805
Without any destinations enabled, the `analytics.min.js` file is about 62KB. Each time you enable a destination, the file's size may increase slightly.
806806

807+
### Cookies set by Analytics.js
808+
809+
Segment sets three cookies in general:
810+
811+
| Cookie | Description |
812+
| ------------------ | --------------------------------------------------------------------------------- |
813+
| `ajs_anonymous_id` | An anonymous ID generated by Analytics.js, used for Segment calls. |
814+
| `ajs_group_id` | A group ID that can be specified by making a `group()` call with Analytics.js. |
815+
| `ajs_user_id` | A user ID that can be specified by making an `identify()` call with Analytics.js. |
816+
817+
For Google Chrome, these cookies expire by default **one year** after the date created. Other [supported browsers](/docs/connections/sources/catalog/libraries/website/javascript/supported-browsers/) might have a different expiration time.
818+
819+
Some user/group traits are also stored in `localStorage`:
820+
821+
| Cookie | Description |
822+
| ---------------------- | --------------------------------------------------- |
823+
| `ajs_user_traits` | The traits that are passed in an `identify()` call. |
824+
| `ajs_group_properties` | The properties that are passed in a `group()` call. |
825+
826+
Note that `localStorage` variables don't expire because the browser defines that functionality.
827+
807828
### Local storage cookies used by Analytics.js
808829

809830
Analytics.js uses `localstorage` cookies if you have retries enabled, to keep track of retry timing.

0 commit comments

Comments
 (0)