Hybrid Event Model
When building your own integration, decide which events the browser sends and which the server sends — the browser owns the context, the server owns the truth.
When you build your own Tugus integration, split events between the browser (JS SDK) and the server (HTTP API / CAPI) instead of sending everything from one side. The browser owns the context, the server owns the truth — the established pattern for hybrid tracking.
The principle
Every event has exactly one authoritative sender.
| Browser (JS SDK) | Server (HTTP API / CAPI) | |
|---|---|---|
| Owns | Journey & interaction | Business & backend truth |
| Knows | URL, referrer, UTM, click IDs (gclid/fbclid), real IP/User-Agent, consent state | Confirmed orders, real amounts, COGS/profit, cancellations, subscription lifecycle |
| Works without the other? | Yes — no server call needed | Yes — webhook, ERP sync or cron, no browser needed |
Event ownership
| Event | Sender | Why |
|---|---|---|
| pageview | Browser | only the browser knows URL / referrer / UTM |
| view_content | Browser | product detail journey |
| view_item_list | Browser | category / search list view |
| search | Browser | search input in the storefront |
| button_click, outbound_click | Browser | pure DOM interaction (CTA, outbound) |
| add_to_cart, view_cart | Browser | interaction, no reliable backend trigger |
| initiate_checkout, add_shipping_info, add_payment_info | Browser | checkout journey |
| purchase | Server | money is truth — ad-blocker-/JS-proof, carries revenue + COGS |
| refund | Server | originates in the backend / ERP, no browser involved |
| subscribe | Server | renewal / cancellation from the backend or a cron job |
| identify | Server | profile / PII enrichment, no browser context required |
See the full Standard Events catalog for every event name.
Why split instead of sending everything twice?
- No double counting, no dedup handshake. Because browser and server events
don't overlap, you never need to coordinate a shared
event_id. - Journey events keep their context. A server-side
pageviewarrives "naked" — without referrer, UTM or click IDs. Keep those in the browser. - Business events stay reliable. Ad blockers, JS errors and closed tabs can
drop a browser
purchase. The server copy always gets through. - Cleaner consent handling. The browser SDK already gates journey events behind the consent banner; business events are backend facts.
If you do send the same event from both the browser and the server (e.g. a
hybrid purchase), Tugus merges them into one — see
Deduplication.