Batch your requests
Send multiple users per request instead of making one API call per user. Batching reduces HTTP overhead and improves throughput.Avoid
1,000 requests with 1 user each
Prefer
1 request with 1,000 users
Use consistent identifiers
Always use the same primary identifier for a given user across all your events. Inconsistent identification creates duplicate profiles.Example: consistent vs. inconsistent
Example: consistent vs. inconsistent
Consistent — All events use Inconsistent — Sometimes email-only, sometimes user_id-only:The inconsistent approach may create two separate profiles until the system can merge them. Providing both identifiers together ensures immediate matching.
user_id:Follow naming conventions
Usesnake_case for event names and property keys. Be consistent — add_to_cart and addToCart are treated as two different event types.
| Do | Don’t |
|---|---|
purchase | Purchase, PURCHASE |
add_to_cart | addToCart, AddToCart |
page_view | pageView, PageView |
product_name | productName, ProductName |
Always send timestamps
When you have the actual time an event occurred, include it in thetimestamp field. This is especially important for:
- Historical imports — backfilling data from your database
- Offline events — POS transactions, call center interactions
- Queued events — events that were collected offline and sent later
Handle errors properly
After each API call, check the response for rejected users.Always log the
trace_id from every response. If you need to contact RevBridge support, the trace ID allows us to quickly locate your request.Be aware of idempotency
The Events API does not deduplicate events. If you send the same event twice, it will be recorded twice. Design your integration to avoid double-sends:- Use a send log. Track which events you’ve successfully sent (by your own event ID or a hash) and skip duplicates on retry.
- Handle retries carefully. Only retry when you receive a network error or
503. A202response means the data was accepted — do not re-send it. - Check
users_accepted. On202, only retry the users listed in theerrorsarray after fixing the validation issues.
Validate before sending
Catch problems early by validating your data before making API calls:- Every user has at least one primary identifier (
user_id,email,phone_number, oranon_id) - Every user has at least one event
- Every event has a non-empty
event_name revenueandevent_valueare numeric (not strings)timestampis in ISO 8601 format when provided- The batch has no more than 1,000 users
Optimize payload size
Keep your payloads efficient:- Only send properties that are relevant to each event. Avoid sending empty strings or null values.
- Use short, descriptive property names.
- For large imports, split into multiple requests of 500–1,000 users each.
- Total payload must be under 10 MB per request.
