laravel-segment
laravel-segment copied to clipboard
Support context on a per-event basis
The batch endpoint allows individual context, per https://segment.com/docs/connections/sources/catalog/libraries/server/http-api/#batch
context Object, optional The same as Context for other calls, but it will be merged with any context inside each of the items in the batch.
This updates the track and identify methods to take in an optional context array, which carries through to the final API call.
It's useful to be able to pass in page context or anything that may change per event.