Give every event a clear shape
When
event_id or ts is missing, the SDK creates it. A generated event ID helps with correlation. track() does not acknowledge ingestion or promise exactly-once delivery.
Name outcomes consistently
Use Bily’s current names for standard commerce and application outcomes. Use stable snake_case names only for product-specific outcomes that have no standard event. Good application event names:workspace_createdintegration_connectedbilling_checkout_completedproduct_error_encountered
Track an outcome only when it is true
Send an event only after the state it names is true.Keep commerce data typed
Useproducts for product, cart, and checkout activity. Each product requires id, name, price, and currency.
order when an event represents one order. Put its products in order.products.
order.total is missing, the SDK calculates it from product price and quantity. Total, tax, discount, and shipping values can all be zero.
Add only the customer context you need
The optionalclient object applies only to the event you send.
userId to extra contact fields. Add email, phone, address, date of birth, or gender only when you have a documented need and permission.
Preserve page and acquisition context
Use typed page fields when an explicit event needs that context:sourceUrl and referrer are inputs. They do not define a public first-touch or last-touch attribution rule. Use Bily’s returned analytics fields as the reporting contract. Do not infer undocumented identity merging or attribution behavior.
Give each property one meaning and type
Keep the meaning and type of every property stable.
Do not change a released property from a number to a formatted string. If its meaning changes, add a new, clearly named property.
Prepare the contract for review
For each event, record:- the exact name and owner;
- the successful trigger;
- required and optional fields;
- field types and allowed values;
- customer-data classification;
- an example payload;
- a test and expected result.
Payload reference
See every typed SDK field.
Validate the model
Prove the names, payloads, and firing behavior before you release.