Server-Side
Deduplication
How Tugus prevents duplicate events client-side and server-side via deterministic event IDs.
Tugus prevents duplicate events on two levels: client-side via session storage and server-side via a deterministic event_id.
Automatic event_id
The script generates a deterministic ID for every event, derived from context data. Identical events (same type + same page + same time window) receive the same ID — platforms like Meta CAPI ignore duplicates automatically.
Passing your own event_id
For server-side events, always pass your own stable ID — e.g. order_id + event_name:
tugus.track('purchase', {
order_id: 'ORD-2024-001',
event_id: 'purchase_ORD-2024-001', // stable, reproducible ID
value: 99.80,
currency: 'EUR',
})// Server-side
Http::post('https://collect.tugus.io/collect/' . $apiKey, [
'event' => 'purchase',
'event_id' => 'purchase_' . $order->id, // prevents double billing
'order_id' => (string) $order->id,
'value' => $order->total,
]);If the browser script and your server send the same event (e.g. purchase), send both with the same event_id. Meta CAPI and GA4 deduplicate automatically — no double reporting.