User Statistics

Gamepot automatically saves all logs during login or payment. However, if you want to save logs without using login or payment, you can send them using logEvent, and they will be saved in the same way.

(Precautions) When using login/payment, the logs are automatically recorded, and this feature is not required. It is recommended to use this only when saving statistical logs for separate logins and payments, as using both at the same time may result in duplicate logs.

Install

No separate installation is required. If the basic SDK is installed, you can send events through the logEvent function.

How to Use

The user ID must be entered for the logs to be recorded correctly.

NBase.setMemberId("userId");

How to Send Events After Login

NBase.trackEvent("loginlogs", mapOf("metadata" to "metadata")) { status, e ->
    if (e != null) {
        Toast.makeText(this, e.message, Toast.LENGTH_LONG).show()
    } else {
        Toast.makeText(this, status.toString(), Toast.LENGTH_LONG).show()
    }
}

How to Send Events After Registration

NBase.trackEvent("joins", mapOf("metadata" to "metadata")) { status, e ->
    if (e != null) {
        Toast.makeText(this, e.message, Toast.LENGTH_LONG).show()
    } else {
        Toast.makeText(this, status.toString(), Toast.LENGTH_LONG).show()
    }

How to Send Events After Payment

val eventParams = mapOf(
    "status" to true,
    "productId" to "productId",
    "paymentId" to "google",
    "orderId" to "order_id",
    "currency" to "USD",
    "price" to 0.99,
    "server_id" to "world#1",
)
GamePot.trackEvent("purchases", eventParams) {status, e ->
    if (e != null) {
        Toast.makeText(this, e.message, Toast.LENGTH_LONG).show()
    } else {
        Toast.makeText(this, status.toString(), Toast.LENGTH_LONG).show()
    }
}
Name
Type
Description
Required

productId

string

Product ID

Y

paymentId

string

google, apple, amazon, one

Y

orderId

string

Receipt Number for Purchase

Y

currency

string

화폐 단위

Y

price

double

구매 가격

Y

serverId

string

서버 ID

N

  1. The SDK automatically enhances events with useful information such as the operating system, app version, etc.

  2. You can manage the logs automatically sent to the server. This SDK does not automatically track events, and you must manually call trackEvent. Therefore, it is generally recommended to track events at least when the app starts.

  3. The trackEvent function does not run in the background.

  4. Custom properties only allow string and numeric values."

Last updated