Zum Hauptinhalt springen
Version: Aktuelle Plattform

Send and Verify the First Event

Initialization automatically queues a page_view. Send a product view as the first explicit commerce event, then flush the queue so you do not need to wait for the default interval.

Send a product view​

Run this after window.upsurge.isInitialized() returns true:

window.upsurge.trackProductView({
product_id: 'SKU-TRAIL-123',
product_name: 'Trail Runner',
product_category: 'Shoes',
product_price: 129.0,
currency: 'USD',
});

await window.upsurge.flush();

Use stable catalog IDs. Monetary fields are numeric values in the stated currency; use one representation consistently across your integration.

Verify the network response​

  1. Open browser developer tools and select Network.
  2. Filter for events/batch.
  3. Confirm the request URL uses your Upsurge origin, not the storefront origin.
  4. Confirm the SDK first bootstraps with site_id, then sends the batch with Authorization: Bearer <runtime_token> and no API key.
  5. Inspect the response.

A fully successful batch returns 201 and a body shaped like this:

{
"success": true,
"data": {
"processed": 2,
"succeeded": 2,
"failed": 0,
"results": [
{
"event_id": "evt_example_1",
"timestamp": "2026-07-11T20:00:00.000Z",
"success": true
},
{
"event_id": "evt_example_2",
"timestamp": "2026-07-11T20:00:00.010Z",
"success": true
}
]
}
}

207 means the request was accepted but at least one event failed. Read each item in results before treating the batch as successful.

Verify Analytics​

  1. Open Dashboard → Analytics.
  2. Choose a date range that includes today.
  3. Select the connected site, or leave the site filter on all sites.
  4. Select the first-party data source.
  5. Refresh the page after the ingestion request succeeds.

The event totals and activity timeline should include the new activity. Depending on the analytics deployment, aggregation may take a short time after the ingestion response.

Completion checklist​

  • The core script returns 200.
  • window.upsurge.isInitialized() returns true.
  • The batch request targets the Upsurge origin.
  • The batch reports no failed events.
  • Analytics shows activity for the correct site and date range.

Next, implement the full commerce event set or start your first overlay or chatbot.