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
By default Analytics.js uses `localStorage` as its preferred storage location, with Cookies as a fallback when `localStorage` is not available or not populated. An in-memory storage is used as a last fallback if all the previous ones are disabled.
146
+
147
+
Default Storage Priority:
148
+
149
+
```md
150
+
LocalStorage -> Cookie -> InMemory
151
+
```
152
+
153
+
Some scenarios might require to switch the priority of the storage systems.
154
+
155
+
- Apps that move the user across different subdomains
156
+
- Apps where the server needs control over the user data
157
+
- User Consent
158
+
- Availability
159
+
160
+
The storage priority can be configured in the Analytics.js client using the `storage` property either globally or only for user or group data.
161
+
162
+
The `storage` property accepts an array of supported storage names (`localStorage`, `cookie`, `memory`) to be used in the priority order of the array.
163
+
164
+
```js
165
+
analytics.load('writeKey', {
166
+
// Global Storage Priority: Both User and Group data
0 commit comments