User Experience Analytics client-side storage cookies

  • Release version: Xanadu
  • Updated August 1, 2024
  • 2 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of User Experience Analytics client-side storage cookies

    User Experience Analytics leverages the SNAnalytics JavaScript SDK embedded in Platform Analytics, Core UI, and the Service Portal to track client-side user activity. This SDK uses session storage and local storage within the browser to gather and maintain analytics data essential for understanding user interactions.

    Show full answer Show less

    Client-side Storage Structure and Usage

    All local storage keys follow the structure: sn:{APIKEY}:{KEY NAME}, where each portal has a unique API key. For example, a key could be structured as sn:abc:tab.

    Session Storage

    Session storage holds temporary data during the lifespan of a browser tab and is cleared when the tab closes. It helps maintain state across page refreshes and navigations. Key session storage items tracked include:

    • srt: Timestamp of the last successful communication with the User Experience Analytics server.
    • data: Queue of temporarily stored analytics data points, periodically sent to the backend.
    • page: The current page name, captured automatically.
    • tab: A randomly generated unique identifier for the current browser tab.

    Local Storage

    Local storage retains persistent data such as tracking consent, user identification (hashed), and unique browser identifiers. This data persists across sessions until the user clears their browsing data. Key local storage variables include:

    • browser: Unique identifier for the browser instance.
    • client: Server-assigned ID linked to the browser identifier.
    • user: Hashed user ID provided by the customer.
    • consent: Boolean indicating if the user consents to tracking.

    To delete local storage variables, users must clear their browser’s cookies and site data via browser settings.

    Data Storage and Compliance

    Before the Yokohama release, analytics data is encrypted at rest and stored in a centralized multi-tenant ServiceNow repository located in Canada. Canadian data protection laws (PIPEDA) are recognized by the EU as providing adequate protection under GDPR, ensuring compliance with EU standards.

    Data is anonymized before storage and deleted after retention periods: single session data is kept for 3 months, while aggregated analytics data is retained for 2 years, supporting both privacy and long-term analysis requirements.

    To track client-side user activity, User Experience Analytics 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.

    The table lists the keys and values stored on session storage.
    Key Description
    srt Server Response Time. The last time SNAnalytics successfully communicated with the User Experience Analytics 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 User Experience Analytics 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.

    The table lists the keys and values stored on local storage.
    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

    To delete local storage variables, the user must clear the browsing data from within their browser. For example, in the Chrome browser, select History > Show Full History > Clear browsing data. In the Clear browsing data window, select Cookies and other site data and then select Clear data.
    Settings to clear local storage cookies.

    Data storage

    On releases before Yokohama, data is encrypted at rest. It is stored in a central ServiceNow® multi-tenant repository in Canada only. Canada's data protection laws (Personal Information Protection and Electronic Documents ACT (PIPEDA)) have been recognized by the EU as providing adequate protection for personal data. This adequacy status ensures that any personal data processing is done in accordance with EU standards under GDPR. This means that personal data can be transferred to Canada and is subject to an essentially equivalent level of protection as under EU laws.

    Data is anonymized before it’s sent to storage, and deleted at the database level after a retention period of 2 years.

    For Xanadu and prior releases, single session data is retained for 3 months, and aggregated analytics is retained for 2 years.