Events
Product analytics — capture events correlated to a person and session.
// access
client.eventsProduct analytics — capture events correlated to a person and session.
Events
classclient.events
track() is buffered by default (NexusConfig.batch) and shipped on a
background thread, so it costs microseconds in a request handler. Call
flush (or client.flush()) to force delivery — the SDK also
flushes at interpreter exit.
Extends Resource.
track()
methoddef track(name, properties=None, *, timestamp=None, distinct_id=None, session_key=None, device_key=None, release=None, app_version=None, os_type=None, os_version=None, browser=None, **extra_properties) -> NoneCapture one event.
client.events.track("order_placed", {"total": 42, "currency": "USD"})
client.events.track("signup", plan="pro") # kwargs become propertiestimestamp is ISO-8601; omit it and the server stamps arrival time.
Parameters
Prop
Type
batch()
methoddef batch(events, *, distinct_id=None, session_key=None, device_key=None, release=None, app_version=None, os_type=None, os_version=None, browser=None) -> intSend many events sharing one identity immediately (no buffering).
Each item is {"name": str, "properties": dict, "timestamp": str}.
Returns the number of events the server wrote.
Parameters
Prop
Type
Returns int
flush()
methoddef flush(timeout=None) -> NoneShip everything buffered right now.
Parameters
Prop
Type
capture
aliascapture = trackAlias of track.
