Up to date

This page is up to date for Godot 4.3. If you still find outdated information, please open an issue.

POGRClient

Inherits: BlaziumClient < Node < Object

Node for connecting to the POGR analytics service.

Description

The POGRClient node provides an interface for connecting to the POGR analytics service. Find out more on the pogr.gg website.

The normal flow is as follows:

  1. Initiate a session using init method.

  2. Send data using data, event, logs, metrics and monitor methods, depending on use case.

  3. Close the session using end method at the end of the game.

Note: All methods are non blocking and can be awaited in order to get the result.

For tags parameter, valid tags are:

var valid_tags = ["steam_id", "twitch_id", "association_id", "pogr_game_session", "xbox_id", "battlenet_id", "twitter_id", "linkedin_id", "pogr_player_id", "discord_id", "override_timestamp"]

Properties

String

build_id

""

String

client_id

""

Methods

POGRResponse

data(tags: Dictionary, data: Dictionary)

POGRResponse

end()

POGRResponse

event(event_name: String, sub_event: String, event_key: String, flag: String, type: String = "user-event", tags: Dictionary = {}, data: Dictionary = {})

String

get_pogr_url() const

String

get_session_id()

POGRResponse

init(association_id: String)

POGRResponse

logs(log: String, severity: String = "info", environment: String = "dev", service: String = "gameclient", type: String = "user-event", tags: Dictionary = {}, data: Dictionary = {})

POGRResponse

metrics(metrics: Dictionary, environment: String = "dev", service: String = "gameclient", tags: Dictionary = {})

POGRResponse

monitor(settings: Dictionary)


Signals

log_updated(command: String, logs: String) 🔗

Signals a log from a command.


Property Descriptions

String build_id = "" 🔗

The build ID obtained from the pogr Game Client page.


String client_id = "" 🔗

The client ID obtained from the pogr Game Client page.


Method Descriptions

POGRResponse data(tags: Dictionary, data: Dictionary) 🔗

Send unstructured data. Call init first.

Returns a POGRResponse object that has a POGRResponse.finished signal that is emitted when finished.

var res :POGRResult = await data({"custom_data": "my_data"}).finished
if res.has_error():
    print(res.error)

POGRResponse end() 🔗

Send end request. Call init first.

Returns a POGRResponse object that has a POGRResponse.finished signal that is emitted when finished.

var res :POGRResult = await end().finished
if res.has_error():
    print(res.error)

POGRResponse event(event_name: String, sub_event: String, event_key: String, flag: String, type: String = "user-event", tags: Dictionary = {}, data: Dictionary = {}) 🔗

Send event with unstructured data. Call init first.

Returns a POGRResponse object that has a POGRResponse.finished signal that is emitted when finished.

var res :POGRResult = await event("combat", "enemy_killed", "attack", "completed", "user-event").finished
if res.has_error():
    print(res.error)

String get_pogr_url() const 🔗

Get the pogr url.


String get_session_id() 🔗

Get the session id. This is a unique identifier for the current session generated after init is called.


POGRResponse init(association_id: String) 🔗

Send init request. Needs to be called first. Needs to have set before client_id and build_id.

Returns a POGRResponse object that has a POGRResponse.finished signal that is emitted when finished.

var res :POGRResult = await init().finished
if res.has_error():
    print(res.error)

POGRResponse logs(log: String, severity: String = "info", environment: String = "dev", service: String = "gameclient", type: String = "user-event", tags: Dictionary = {}, data: Dictionary = {}) 🔗

Add logs to the analytics. Call init first.

Returns a POGRResponse object that has a POGRResponse.finished signal that is emitted when finished.

var res :POGRResult = await logs("logs 123").finished
if res.has_error():
    print(res.error)

POGRResponse metrics(metrics: Dictionary, environment: String = "dev", service: String = "gameclient", tags: Dictionary = {}) 🔗

Add metrics to the analytics. Call init first.

Returns a POGRResponse object that has a POGRResponse.finished signal that is emitted when finished.

var res :POGRResult = await metrics({"FPS": Engine.get_frames_per_second()}).finished
if res.has_error():
    print(res.error)

POGRResponse monitor(settings: Dictionary) 🔗

Send monitor request.

Returns a POGRResponse object that has a POGRResponse.finished signal that is emitted when finished.

var res :POGRResult = await monitor({"my_setting": "test"}).finished
if res.has_error():
    print(res.error)