Error sessions analysis with JavaScript errors

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1 servicesAll 2065 services
Error sessions analysis with JavaScript errors
Medium
from 1 business day to 3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Error Sessions Analysis (JavaScript Errors)

Error sessions are user sessions with one or more JavaScript errors. JS errors break interface functionality, block forms and checkout, directly reducing conversion.

JavaScript Error Capture Setup

// Capture unhandled errors
window.addEventListener('error', function(event) {
  const errorInfo = {
    message: event.message,
    source: event.filename?.split('/').pop(),
    line: event.lineno,
    col: event.colno,
    stack: event.error?.stack?.slice(0, 500),
    page: window.location.pathname,
    user_agent: navigator.userAgent.slice(0, 100)
  }

  // Send to GA4
  gtag('event', 'js_error', errorInfo)

  // Send to Sentry/Bugsnag
  Sentry.captureException(event.error, {
    extra: errorInfo
  })
})

// Capture unhandled Promise rejections
window.addEventListener('unhandledrejection', function(event) {
  gtag('event', 'promise_rejection', {
    message: event.reason?.message || String(event.reason),
    page: window.location.pathname
  })
})

// Capture fetch/XHR errors
const originalFetch = window.fetch
window.fetch = async function(...args) {
  try {
    const response = await originalFetch(...args)
    if (!response.ok) {
      gtag('event', 'fetch_error', {
        url: args[0].toString().split('?')[0],
        status: response.status,
        page: window.location.pathname
      })
    }
    return response
  } catch (err) {
    gtag('event', 'fetch_exception', {
      url: args[0].toString().split('?')[0],
      message: err.message
    })
    throw err
  }
}

Sentry: Full Error Tracking

// sentry.init.js
import * as Sentry from '@sentry/browser'
import { BrowserTracing } from '@sentry/tracing'

Sentry.init({
  dsn: 'https://[email protected]/yyy',
  integrations: [
    new BrowserTracing(),
    new Sentry.Replay({
      maskAllText: false,
      blockAllMedia: false
    })
  ],
  tracesSampleRate: 0.1,   // 10% for performance
  replaysSessionSampleRate: 0.05,  // 5% of sessions
  replaysOnErrorSampleRate: 1.0,   // 100% on error
})

Analyzing Error Impact

Compare conversion rates for sessions with/without errors:

  • Sessions with errors typically have 30-50% lower conversion
  • Checkout errors have highest impact on revenue
  • Navigation/menu errors reduce time on site

Delivery Time

Setting up error capture and analysis — 1 business day.