Local Storage in Embeddables
As described in our User Data documentation, Embeddables stores user data in multiple contexts. In the Embeddables Builder, you can choose which context to store each value, on a field-by-field basis. The three contexts are:- Embeddable Context: In-memory storage that exists only during the current session.
- Local Storage Context: Persistent browser storage that remains after tab/browser closure. (Data stored here is also stored in #1).
- Embeddables Cloud Context: Data stored on our servers to provide the analytics insights in the Embeddables Web App. (Data stored here is also stored in #1 and #2).
Local Storage vs Cookies
Comparison table
Feature | Local Storage | Cookies |
---|---|---|
Storage Capacity | 5-10MB | 4KB |
Expiration | Doesn’t expire automatically | Can be set to expire |
Sent with Requests | No, stays in browser | Yes, sent with every HTTP request |
Accessibility | Same-origin only | Can be configured for cross-origin |
Manipulation | JavaScript only | JavaScript or HTTP headers |
Duration of Storage
Data stored in Local Storage persists until:- The user manually clears their browser data/cache
- The user uses private/incognito browsing
- The user switches to a different browser or device
Privacy Considerations
Local Storage is generally considered more privacy-friendly than cookies because:- It’s not automatically sent with HTTP requests
- It’s limited to the domain that created it
- It doesn’t support the tracking capabilities that third-party cookies enable