event_id pattern.
How idempotency works
Every event accepts anevent_id field. When the same event_id arrives more than once, the pipeline marks the second occurrence as a duplicate and excludes it from analytics. Your conversion counts stay accurate even if you retry a request multiple times.
The rule: generate the event_id once, before your first attempt, and reuse the same value for every retry of that event.
Implementation pattern
Retry schedule
Cap your delay at 30–60 seconds. After 5 failed attempts, log the event and alert — do not retry indefinitely.
When to retry vs when to stop
Persisting event_id for critical events
For high-value conversions (purchases, subscriptions), generate and persist theevent_id before the network call — so you can retry even after a process restart: