Aller au contenu principal
Version: Plateforme actuelle

Browser SDK

The Upsurge browser SDK captures storefront behavior and loads eligible overlay and chatbot experiences. The core bundle is required; feature bundles load only when the public configuration API returns a matching campaign.

Bundles​

BundleResponsibilityLoading behavior
upsurge.min.jsInitialization, session context, event queue, transport, and public methodsInstall on every tracked page.
upsurge-overlays.min.jsOverlay triggers, frequency caps, rendering, submissions, and lifecycle eventsLoaded by the core SDK only when an overlay matches.
upsurge-chatbot.min.jsChatbot widget, session, message transport, and response componentsLoaded by the core SDK only when a chatbot matches.
upsurge-search.min.jsHeadless search client, autocomplete, full results, and Smart Collection elementsLoaded explicitly only on pages that render Smart Search.

Runtime lifecycle​

  1. The core script resolves the queued init call.
  2. The SDK creates or resumes a session and collects browser context.
  3. Automatic page-view and SPA navigation tracking begins unless disabled.
  4. Events enter a bounded browser queue and flush in batches.
  5. Overlay and chatbot configuration is fetched without blocking event capture.
  6. Matching feature bundles load and register their triggers.

Public method groups​

GroupMethods
Lifecycleinit, ready, flush, shutdown, isInitialized, getDiagnostics
Identityidentify, reset, getUserId, getSessionId, getDeviceId
Generic eventstrack, trackCustom
CommercetrackPageView, trackProductView, trackAddToCart, trackRemoveFromCart, trackCheckoutStart, trackCheckoutComplete, trackPurchase, trackSearch, setCartContext, getJourneyToken
RecommendationsgetRecommendations, trackRecommendationShown, trackRecommendationClicked
OverlaystrackOverlayShown, trackOverlayClicked, trackOverlayDismissed, refreshOverlays, resetOverlays
ChatbotstrackChatbotOpened, trackChatbotMessage and runtime lifecycle helpers
PrivacyisFingerprintingEnabled, clearFingerprint

Start here​

  • Installation — add the script and initialize it against the right origin.
  • Configuration — defaults, queue settings, capture, privacy, and callbacks.
  • Public methods — signatures and expected behavior.
  • Event tracking — event names and commerce payloads.
  • Identity and privacy — sessions, authenticated users, fingerprinting, DNT, and consent.
  • Smart Search — platform adapters, custom elements, progressive fallback, and the headless search client.
Version

The current core SDK reports version 2.4.0. Feature bundle URLs include that version as a cache-busting query parameter.