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
| Bundle | Responsibility | Loading behavior |
|---|---|---|
upsurge.min.js | Initialization, session context, event queue, transport, and public methods | Install on every tracked page. |
upsurge-overlays.min.js | Overlay triggers, frequency caps, rendering, submissions, and lifecycle events | Loaded by the core SDK only when an overlay matches. |
upsurge-chatbot.min.js | Chatbot widget, session, message transport, and response components | Loaded by the core SDK only when a chatbot matches. |
Runtime lifecycle
- The core script resolves the queued
initcall. - The SDK creates or resumes a session and collects browser context.
- Automatic page-view and SPA navigation tracking begins unless disabled.
- Events enter a bounded browser queue and flush in batches.
- Overlay and chatbot configuration is fetched without blocking event capture.
- Matching feature bundles load and register their triggers.
Public method groups
| Group | Methods |
|---|---|
| Lifecycle | init, flush, shutdown, isInitialized |
| Identity | identify, reset, getUserId, getSessionId, getDeviceId |
| Generic events | track, trackCustom |
| Commerce | trackPageView, trackProductView, trackAddToCart, trackRemoveFromCart, trackCheckoutStart, trackCheckoutComplete, trackPurchase, trackSearch |
| Recommendations | trackRecommendationShown, trackRecommendationClicked |
| Overlays | trackOverlayShown, trackOverlayClicked, trackOverlayDismissed, refreshOverlays, resetOverlays |
| Chatbots | trackChatbotOpened, trackChatbotMessage and runtime lifecycle helpers |
| Privacy | isFingerprintingEnabled, 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.
Version
The current core SDK reports version 1.0.0. Feature bundle URLs include that version as a cache-busting query parameter.