GoodAnalytics.Core.Sessions.SessionFields (GoodAnalytics v0.1.1)

Copy Markdown View Source

Pure per-event session field computation.

Summary

Functions

Returns true when a session meets the GA4 engaged-session thresholds.

Builds the attrs for a brand-new session's first event.

Computes field changes for a subsequent event on a live session.

Functions

engaged?(session_or_attrs)

Returns true when a session meets the GA4 engaged-session thresholds.

new_session_attrs(event_type, attrs, ts)

@spec new_session_attrs(String.t(), map(), DateTime.t()) :: map()

Builds the attrs for a brand-new session's first event.

update_session_attrs(live, event_type, attrs, ts)

@spec update_session_attrs(
  GoodAnalytics.Core.Sessions.Session.t(),
  String.t(),
  map(),
  DateTime.t()
) ::
  map()

Computes field changes for a subsequent event on a live session.