Cookies and storage
The Shuttlebase snippet uses a small, fixed set of cookies and browser storage keys. This page lists all of them and explains what happens when a browser blocks storage.
Cookies
Section titled “Cookies”The snippet sets these cookies for normal visitors. Its policy permits no others.
All cookies are set client-side via document.cookie. They are first-party, scoped to domain= the registrable domain (eTLD+1, so shared across subdomains, with a host-only fallback when the browser rejects the domain write), path=/, SameSite=Lax, and Secure on HTTPS.
| Cookie | Purpose | Lifetime |
|---|---|---|
msai_user_id | Anonymous visitor UUID. Identifies a returning visitor without any personal data. | 365 days |
msai_bucketed_experiments | Map of experiment to variant assignments. Keeps a visitor in the same variant across visits. | 365 days |
msai_should_track | Cached consent decision, so the snippet does not re-query your consent tool on every page. Holds true or false, where true means tracking is allowed. | 180 days |
msai_uj | Experiment-level state plus a summary of the visitor’s journey across the site. | 365 days |
localStorage
Section titled “localStorage”| Key | Purpose | Lifetime |
|---|---|---|
msai_user_id | Mirror of the user ID cookie. | No expiry — persists until the visitor clears site data |
msai_bucketed_experiments | Mirror of the assignment cookie. | No expiry — persists until the visitor clears site data |
msai_analytics_session_count | Lifetime session and event counters. | No expiry — persists until the visitor clears site data |
msai_uj | Full journey record; the cookie holds a summary only. | No expiry — persists until the visitor clears site data |
msai_dq | Queue of events pending send, for batching to reduce network traffic. | No expiry — persists until the visitor clears site data |
sessionStorage
Section titled “sessionStorage”| Key | Purpose | Lifetime |
|---|---|---|
msai_analytics_session | Current session record, including UTM parameters and referrer. | Tab session |
msai_session_event_count | Event counter for the current session. | Tab session |
What consent revocation clears
Section titled “What consent revocation clears”When a visitor revokes consent, the snippet clears msai_bucketed_experiments, msai_user_id, msai_analytics_session, and msai_analytics_session_count from cookies, localStorage, and sessionStorage. msai_should_track is deliberately preserved, since it is the record of the refusal.
When consent is later granted, the page reloads so the snippet can start tracking with a clean slate.
QA and developer tooling
Section titled “QA and developer tooling”These keys exist only for preview, QA, and developer testing. Normal visitors never receive them.
| Key | Type | Purpose |
|---|---|---|
msai_deployed_only | Cookie or sessionStorage | Overrides the snippet to show deployed winners without running experiments. |
msai_preview_bucketing | sessionStorage | State for preview-mode bucketing. |
msai_opt_out | sessionStorage | Session-scoped tracking opt-out for QA. |
msai_preview_experiments_cache | localStorage | Cache of preview experiment config. Written by writePreviewExperimentsCache(). |