Usage Insights client-side storage cookies
Summarize
Summary of Usage Insights client-side storage cookies
Usage Insights tracks client-side user activity within ServiceNow applications using the SNAnalytics JavaScript SDK embedded in Platform Analytics, Core UI, and Service Portal. This SDK leverages browser session storage and local storage to manage and persist analytics data essential for monitoring user interactions and system performance.
Show less
Key Features
- Key Structure: Locally stored keys follow the pattern
sn:{APIKEY}:{KEY NAME}. Each portal has a unique API key, ensuring data is correctly attributed. - Session Storage: Used to temporarily hold analytics data during the lifespan of a browser tab. It includes:
- srt: Timestamp of the last successful server communication.
- data: Queue of analytics events awaiting backend upload.
- page: Current page name automatically recorded.
- tab: Unique identifier for the active browser tab.
- Local Storage: Maintains persistent information such as:
- browser: Unique identifier for the browser instance.
- client: Server-assigned ID linked to the browser key.
- user: Hashed user ID provided by the customer.
- consent: Boolean flag indicating user tracking consent.
- Deleting Local Storage: Users must clear browser cookies and site data to remove local storage variables, typically via browser history settings.
- Data Storage and Security: Collected data is encrypted at rest and stored in regional, multitenant ServiceNow repositories (Canada, Germany, Japan). Data is anonymized before storage and retained for two years. The Yokohama release includes an additional backup in Canada using prior architecture.
Key Outcomes
ServiceNow customers benefit from robust, privacy-conscious client-side tracking that supports detailed usage analytics while respecting user consent. The combination of session and local storage ensures accurate, session-specific data collection and persistent identifiers for trusted tracking. Data encryption and regional storage policies provide compliance with data protection standards, enabling customers to confidently leverage Usage Insights to improve their platform experience.
To track client-side user activity, Usage Insights uses the SNAnalytics JavaScript SDK that is embedded in Platform Analytics, Core UI, and the Service Portal.
The SNAnalytics SDK uses a combination of session storage and local storage variables to keep track of the information required to facilitate the analytics tracking.
For more information on session storage and local storage, refer to the JavaScript.Info documentation.
For more information on SNAnalytics SDK, see SNAnalytics - Client and SNAnalytics – in the Developer community.
Key structure
All locally stored keys are stored using the following structure: sn:{API_KEY}:{KEY NAME}
Each tracked portal has a unique API_KEY that is stored on the instance. For example, for the portal with an API key abcd and a key name tab, the local key value would be:
sn:abc:tab
Session storage
Session storage is used to maintain the flow of information between web page refreshes and user navigations. Information in session storage is transient and kept available only during the lifespan of the current tab. When a tab is closed, the session storage information is removed.
| Key | Description |
|---|---|
| srt | Server Response Time. The last time SNAnalytics successfully communicated with the Usage Insights server. |
| data | Queue of temporary stored analytics data points, which is periodically flushed to the backend. |
| page | The name of the current page, automatically captured by the Usage Insights server. |
| tab | Randomly generated unique identifier for the current tab. |
Local storage
Local storage is used to maintain tracking consent information, hashed identification of the user (which is cleared when consent is revoked), and randomly generated identifiers for the browser. Local storage variables are persistent locally and are deleted when the user clears their browsing data.
| Key | Description |
|---|---|
| browser | Randomly generated unique identifier for the current browser. |
| client | The server assigned ID mapped to the browser key value. |
| user | Hashed user id, supplied by the customer. |
| consent | A boolean (yes/no) value that indicates whether the user consents to be tracked. |
Deleting local storage
Data storage
Data is encrypted at rest. It’s stored in a central ServiceNow® multitenant repository closest to you, in either AMS (Canada), EMEA (Germany), or APAC (Japan).Data is anonymized before it’s sent to storage, and deleted at the database level after a retention period of two years.
For the Yokohama release, an additional backup copy is stored in a central repository in Canada using the pre-Yokohama architecture.