Give every event a clear shape
| Part | Purpose |
|---|---|
| Event name | Stable description of the outcome |
| Typed fields | client, products, order, page, and search context |
| Custom properties | Application-specific IDs, categories, and safe state |
event_id | Identifier for one logical outcome |
ts | ISO timestamp for the event |
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 title-case names for ecommerce events. Use stable snake_case names for application events. 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.| Property | Recommended value |
|---|---|
| IDs | Stable string or documented numeric ID |
| Currency | Consistent currency code string |
| Money | Finite number in the unit your event plan defines |
| Flags | Boolean, not "true" or "false" |
| Time | ISO timestamp string in ts |
| Category | Small controlled vocabulary |
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.