BilyPayload to track(). Typed fields keep common data consistent, while additional top-level keys let you describe your application.
Build a payload
source to web for you.
For explicit SPA page views, send sourceUrl and pageTitle. For product searches, send searchQuery.
Do not supply an IP address from browser code.
Describe a client
Describe a product
quantity, it defaults to 1. When you provide image, the SDK preserves it.
Describe an order
total is absent, the SDK calculates it from each product’s price and quantity. Zero remains valid for total, tax, discount, and shippingFees.
When a payload contains order, place its products in order.products. Do not rely on the top-level products field for the same event.
Add application properties
Add your own top-level keys when an event needs application-specific properties.event_id and ts when they are absent. Provide them yourself when you already have a stable event ID or timestamp.