Skip to main content

SignupAnalyticsReporter

A class in Root.Township, Features.Analytics.Registration.

Obsolete client singleton that posts sign-up and account-linking analytics (screens, flow start, finish, errors and durations) through the old API client.

Constructors​

MemberWhat it is
SignupAnalyticsReporter()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

8 private and internal fields
MemberWhat it is
private readonly Dictionary<string, object> eventDataProperty bag for the next report, cleared after each one.
private string eventFlowIdID tying the events of one registration or linking flow together.
private Stopwatch flowStopWatchTimes the current registration or linking flow.
private static SignupAnalyticsReporter instanceBacking field for Instance.
private bool isTestModeWhen true, event names get a "Test" prefix. Never set to true in this code.
private static readonly Logger loggerNLog logger for this class.
private string oculusUserIdThe Oculus user ID sent with events on Quest.
private Stopwatch screenStopwatchTimes the current screen.

Properties​

MemberWhat it is
static SignupAnalyticsReporter Instance { get; }The singleton, set in Awake.

Methods​

MemberWhat it is
void AddEventData(string key, object value)Adds a key and value to the property bag sent with the next report.
void ReportLinkingError(string screenName, string error)Reports a linking error with the screen name and error text.
void ReportLinkingFinished()Reports linking finished with the flow duration, then clears the flow ID.
void ReportLinkingStarted()Starts a new flow ID and stopwatch and reports linking started.
void ReportRegistrationError(string screenName, string error)Reports a registration error with the screen name and error text.
void ReportRegistrationFinished()Reports registration finished with the flow duration, then clears the flow ID.
void ReportRegistrationStarted()Starts a new flow ID and stopwatch and reports registration started.
void ReportScreenFinished(string screenName)Reports a screen finished, with seconds since the matching ReportScreenStarted.
void ReportScreenStarted(string screenName)Reports a screen started and restarts the screen stopwatch.
2 private and internal methods
MemberWhat it is
private async void Awake()Sets the singleton (destroying duplicates), starts the stopwatches and, on Quest, fetches the Oculus user ID.
private void PostReport(string eventType)Posts a generic analytics event with the Oculus ID and eventData, logging any exception.