res://addons/w4gd/analytics/analytics.gd

Inherits: Node

A client for interacting with W4 Cloud's analytics service.

Properties

Dictionary

default_props

float

send_frequency

Methods

void

flush ( )

bool

is_session_started ( )

void

lobby_joined ( String p_lobby_id, Dictionary p_props )

void

lobby_left ( Dictionary p_props )

void

send_event ( String p_event_name, Dictionary p_props, String user_id )

void

start_session ( Dictionary p_props )

void

stop_session ( Dictionary p_props )


Signals

error ( Variant msg )

Emitted when there's an error communicating with the server.


session_running_event ( Variant extra_props )

Emitted before sending the "session_running" event to the server, so that extra properties can be added.


Constants

AUTO_CLEAN_UP_SETTING = w4games/analytics/auto_clean_up_on_quit

The full name of the "Auto Clean Up On Quit" project setting.


Property Descriptions

Dictionary default_props

The default properties to send with every event.


float send_frequency

The frequency (in seconds) to send queued data to the server.


Method Descriptions

void flush ( )

Flushes the queue of events, sending them all to the server immediately.


bool is_session_started ( )

Checks if an analytics session has started.


void lobby_joined ( String p_lobby_id, Dictionary p_props )

Sends a 'lobby_joined' event.


void lobby_left ( Dictionary p_props )

Sends a 'lobby_left' event.


void send_event ( String p_event_name, Dictionary p_props, String user_id )

Sends an arbitrary event.


void start_session ( Dictionary p_props )

Starts an analytics sessions. A session represents everything that happens after starting the game executable through when its closed. No data can be sent to the server until the session has started. When gathering analytics, this should be run as early as possible after the game starts.


void stop_session ( Dictionary p_props )

Stops an analytics sessions. This should be run just before exiting the game. It will ensure that any queue events are sent.