Connect a Storefront
Upsurge hosts the production browser SDK and platform APIs. The core SDK loads from cdn.upsur.ge; event, configuration, and widget requests go to dashboard.upsur.ge. Register the storefront domain first so platform traffic can be associated with the correct site.
Get the site ID
Use the path that matches your workspace state.
- During setup
- Add another site
- Server API access
Complete the five-step setup wizard. The success screen provides the public site ID and installation snippet.
Open Dashboard → Sites, select Add site, and complete the site form. The new site ID is safe to place in storefront code.
Open Dashboard → Secret API Keys only for server-to-server REST integrations. These keys are never used by the browser SDK.
The site ID is public. Browser security comes from the short-lived, origin-bound runtime token that the SDK obtains automatically—not from keeping the site ID secret or relying on CORS.
Add the browser script
Replace site_replace_me with the site ID from the dashboard. The production CDN and dashboard origins are fixed platform addresses.
Add this as early as practical in the storefront <head>:
<script>
window.UpsurgeQueue = window.UpsurgeQueue || [];
window.UpsurgeQueue.push([
'init',
{
siteId: 'site_replace_me',
baseUrl: 'https://dashboard.upsur.ge',
conversionEventType: 'purchase',
respectDoNotTrack: true,
},
]);
</script>
<script
async
src="https://cdn.upsur.ge/sdk/upsurge.min.js"
></script>
Load the script from https://cdn.upsur.ge, but set baseUrl to https://dashboard.upsur.ge. If baseUrl is omitted, the SDK defaults to the merchant storefront and incorrectly attempts to call /api/v1/* there.
Queue calls made before the script loads
Because the script is asynchronous, add early calls as arrays:
<script>
window.UpsurgeQueue.push([
'trackProductView',
{
product_id: 'SKU-TRAIL-123',
product_name: 'Trail Runner',
product_price: 129.0,
currency: 'USD',
},
]);
</script>
After initialization, the tracker is available as window.upsurge and you can call its methods directly.
Optional initialization choices
conversionEventTypecan bepurchase(default) orcheckout_complete.respectDoNotTrackdefaults tofalse; enable it when your consent policy requires browser DNT to disable tracking.enableFingerprintingdefaults tofalseand should remain opt-in.- automatic initial page-view and single-page-app navigation tracking are enabled by default.
Continue to Send and verify the first event.