ReportEvent
[Player Network SDK & MSDK] Reports custom events. When users use the Adjust channel, they must register events on the Adjust dashboard in advance and obtain event tokens, to report events successfully.
Supported channels:
- Adjust
- AppsFlyer
- Firebase
[MSDK Only] channels:
- Beacon
- TDM
[Player Network SDK Only] channels:
- INTL
- Garena
Supported Platform
- Unity
- Unreal Engine
Supports
Android, iOS, Windows
platform.Supports
Android, iOS, Windows
platform.caution
Windows platform only supports the INTL channel.
Function Definition
- Unity
- Unreal Engine
void ReportEvent(
string eventName,
Dictionary<string, string> paramsDic,
string spChannels = "",
bool isRealTime = true);
static void ReportEvent(
const std::string &event_name,
std::map<std::string, std::string> ¶ms,
const std::string &specific_channel = "",
bool is_real_time = true,
const std::string &extra_json = "{}");
Input Parameters
- Unity
- Unreal Engine
Parameter Name | Parameter Type | Description |
---|---|---|
eventName | string | Event name 1. For the Adjust channel, enter the event token to track the events. 2. For the AppsFlyer channel, it is recommended to use only lowercase letters and numbers (a-z and 0-9) for the in-app event names. 3. For the Facebook channel, event names and parameter names must consist of 2 to 40 letters and numbers; parameter values cannot exceed 100 characters. 4. For the Firebase channel, names must consist of 1 to 40 letters, numbers, and underscores. Names must start with a letter. Note that event names are case-sensitive, and logging two events whose names differ only by case will result in two different events. |
paramsDic | Dictionary<string, string> | Parameters to report Key-value format Not used for Adjust channel sp can pass an empty dictionary. Paramter cannot contain | symbol. |
spChannels | string | Specified channels 1. Set to a blank string if no channels are specified. By default, a blank string indicates that the initialized channels will be reported. That is, the reporting channels configured in MSDKConfig.ini or INTLConfig.ini. For more information, see MSDK document or Player Network Documentation 2. Specify a channel to report to, such as "Facebook". 3. Specify multiple channels to report to, separating them with single-byte commas, such as: "Facebook,Firebase". |
isRealTime | bool | Whether to report data in real-time |
Parameter Name | Parameter Type | Description |
---|---|---|
event_name | std::string | Event name 1. For the Adjust channel, enter the event token to track the events. 2. For the AppsFlyer channel, it is recommended to use only lowercase letters and numbers (a-z and 0-9) for the in-app event names. 3. For the Facebook channel, event names and parameter names must consist of 2 to 40 letters and numbers; parameter values cannot exceed 100 characters. 4. For the Firebase channel, names must consist of 1 to 40 letters, numbers, and underscores. Names must start with a letter. Note that event names are case-sensitive, and logging two events whose names differ only by case will result in two different events. |
params | std::map <std::string, std::string> | Parameters to report Key value format |
specific_channel | std::string | Specified channels 1. Set to a blank string if no channels are specified. By default, a blank string indicates that the initialized channels will be reported. That is, the reporting channels configured in MSDKConfig.ini or INTLConfig.ini. For more information, see MSDK document or Player Network Documentation 2. Specify a channel to report to, such as "Facebook". 3. Specify multiple channels to report to, separating them with single-byte commas, such as: "Facebook,Firebase". |
is_real_time | bool | Whether to report data in real-time |
extra_json | std::string | The extended field in JSON format Only applicable to Adjust if Adjust partner parameter is used. For example, "{\"isPartnerParameters\":true}". If this field is null or set to false, the reported data will be set to the callback_params in Adjust |
Code Sample
- Unity
- Unreal Engine
Dictionary<string, string> paramsDic = new Dictionary<string, string>();
// TODO: Add key-value pair
UnionAdapterAPI.GetReportService().ReportEvent("event", paramsDic);
std::map < std::string, std::string> _params_map
// TODO: Add key-value pair
GUA_NAMESPACE::GUAReportService::ReportEvent("Event", _params_map);