Question
How can I disable Analytics.js cookies so that the library does not set any cookies by default when loading on my website?
Product
Twilio Segment
Environment
Segment Console
Answer
You can disable all Analytics.js cookies and all other local storage behavior by loading Analytics.js with the setting disableClientPersistence: true. This turns off client-side persistence completely, meaning Analytics.js will not write any userId, anonymousId, traits, group data, or pending events to cookies or localStorage. When this setting is enabled, Analytics.js stores all data in memory only and does not persist identity across page loads.
Additional Information
Learn more about Analytics.js cookies in Client-side Persistence in Analytics-js.