Custom Event Report (ReportEvent)
[Player Network SDK & MSDK] Report custom events.For the Adjust channel, the event must be registered in the Adjust dashboard in advance to obtain the event token before it can be successfully reported.
Supported Channels:
- Adjust
- AppsFlyer
- Firebase
[MSDK only] Channel:
- Beacon
- TDM
[Player Network SDK only] Channel:
- INTL
- Garena
Supported platforms
- Unity
- Unreal Engine
Supports
Android, iOS, Windows platform.Supports
Android, iOS, Windows platform.caution
The 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);
</TabItem>
<TabItem value="UE">
```cpp
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. Adjust channel: Requires filling in the event token to track the event 2. AppsFlyer channel: It is recommended to use only lowercase letters and numbers (a-z and 0-9) for in-app event names 3. Facebook channel: Events and parameters must consist of 2 to 40 alphanumeric characters, and each parameter value cannot exceed 100 characters 4. Firebase channel: Must contain 1 to 40 alphanumeric characters or underscores.The name must start with an alphabetic character.Please note that event names are case-sensitive. Logging two events that differ only in case will result in two separate events. |
| paramsDic | Dictionary<string, string> | Parameters to Report in key-value format Adjust channel does not use this.Can pass an empty dictionary. Parameters cannot contain the | symbol. |
| spChannels | string | Specify Channel 1. If no channel is specified, an empty string can be provided. An empty string will default to reporting to the initialized channel, as configured in MSDKConfig.ini or INTLConfig.ini.For more information, see the MSDK documentation or the Player Network documentation. 2. Specify reporting to a particular channel, for example, "Facebook". 3. Specify reporting to multiple channels, separated by commas, for example, "Facebook, Firebase". |
| isRealTime | bool | Whether to report in real time |
| Parameter name | Parameter Type | Description |
|---|---|---|
| event_name | std::string | Event Name 1. Adjust channel: requires filling in the event token to track the event 2. AppsFlyer channel: it is recommended to use only lowercase alphanumeric characters (a-z and 0-9) for in-app event names 3. Facebook channel: events and parameters must consist of 2 to 40 alphanumeric characters, and the length of each parameter value must not exceed 100 characters 4. Firebase channel: requires 1 to 40 alphanumeric characters or underscores.The name must start with an alphabetic character.Please note that event names are case-sensitive. Logging two events that differ only in case will result in two separate events. |
| params | std::map <std::string, std::string> | Parameters to Report in key-value format |
| specific_channel | std::string | Specify Channel 1. If no channel is specified, you can provide an empty string. An empty string will default to reporting to the initialized channel, as configured in MSDKConfig.ini or INTLConfig.ini.For more information, see the MSDK documentation or the Player Network documentation. 2. Specify reporting to a particular channel, for example, "Facebook". 3. Specify reporting to multiple channels, separated by commas, for example, "Facebook, Firebase". |
| is_real_time | bool | Whether to report in real time |
| extra_json | std::string | Extended Information: Must be in JSON format. Only the Adjust channel considers this parameter. If using Adjust partner parameters, this parameter must be used.Code sample: {"isPartnerParameters":true}.If this field is empty or set to false, the reported parameters will be set to Adjust’s callback_params |
Code Example
- 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);