Browser monitoring's page load timing feature can track sessions by using the sessionStorage API that can store a simple session identifier.
How it works
Here is the basic process for session tracking:
- A session begins when a user visits a website where New Relic's browser monitoring is installed and the privacy setting for tracking is enabled.
- As the user's page is loaded, our browser monitoring script sets a simple session identifier in the browser.
- The script then reads the ID on subsequent page loads, reloads and restores, within the same tab or across new tabs of the same domain.
- If one of the following events occur, the session will end and a new session will begin:
- A session has reached a maximum time of 4 hours
- A page is loaded with a pre-existing session which started more than 4 hours prior
- No pages in the active session are "interacted" with for 30 consecutive minutes. Our definition of an interaction with a web page consists of
Session tracking will not work properly in these situations:
- If users have DOM Storage disabled in their browser.
- If the browser or page is configured to not allow loading and execution of third-party origin scripts through security policies or other means (which naturally means the agent as a whole will not function).
- Browser storage APIs such as LocalStorage are cleared during an active session
Enable or disable tracking
At New Relic, we take data privacy seriously. By default, we do not retain any personal data collected by our browser agent, and you can control session tracking. If you want to enable or disable session tracking on web browsers of visitors to your website:
- Go to one.newrelic.com > Browser > (select an app) > Settings > Application settings.
- In your app's Privacy settings, toggle Session tracking.