--- title: "ユーザー統計" slug: "game-gamepot3-user-analytics" updated: 2026-09-17T09:23:32Z published: 2026-09-17T09:23:32Z canonical: "guide.ncloud-docs.com/game-gamepot3-user-analytics" stale: true --- > ## Documentation Index > Fetch the complete documentation index at: https://guide.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # ユーザー統計 Classic/VPC環境で利用できます。 GAMEPOTは、ログインや決済時にすべてのログを自動的に保存します。ただし、ログインや決済を使わずにログだけを保存する場合は、logEventを介して送信すれば同じように保存できます。 別途インストールする必要はありません。デフォルトの SDKがインストールされている場合、logEvent関数を使用するとイベントを送信できます。 注意 ログイン/決済を使用する場合は自動的に記録されるので、この機能は必要ありません。 別のログインと決済を使用する場合、統計ログを保存する場合にのみ使用することをお勧めします。同時に使用するとログが重複して保存される可能性があります。 ## ユーザー IDの入力 ログが正常に記録されるには、ユーザー IDの入力が必要です。 - Android ``` NBase.setMemberId("userId"); ``` - iOS ``` NBase.setMemberId(memberId: "userId") ``` - Unity ``` NBaseSDK.NBase.setMemberId("userId"); ``` ## ログイン後にイベントを送信する方法 - Android ``` 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() } } ``` - iOS ``` let eventParam: [String: Any] = ["metadata": "metadata"] NBase.trackEvent(event: "loginlogs", params: eventParam) {result in switch result { case .success(let status): // success case .failure(let error): // failure } } ``` - Unity ``` var loginParam = new NBaseSDK.NBase.TrackingParameter(status: true, serverId: "server#1"); NBaseSDK.NBase.trackEvent("loginlogs", loginParam, (status, error) => { if (error != null) { Debug.Log(error.Message.ToString()); return; } }); } } ``` ## 会員登録後にイベントを送信する方法 - Android ``` 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() } ``` - iOS ``` let eventParam: [String: Any] = ["metadata": "metadata"] NBase.trackEvent(event: "joins", params: eventParam) {result in switch result { case .success(let status): // success case .failure(let error): // failure } } ``` - Unity ``` var loginParam = new NBaseSDK.NBase.TrackingParameter(status: true, serverId: "server#1"); NBaseSDK.NBase.trackEvent("joins", loginParam, (status, error) => { if (error != null) { Debug.Log(error.Message.ToString()); return; } }); } } ``` ## 決済後にイベントを送信する方法 - Android ``` 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() } } ``` - iOS ``` let eventParams: [String: Any] = [ "status": true, "productId": "productId", "paymentId": "google", "orderId": "order_id", "currency": "USD", "price": 0.99, "server_id": "world#1" ] NBase.trackEvent(event: "purchases", params: eventParams) {result in switch result { case .success(let status): // success case .failure(let error): // failure } } ``` - Unity ``` var purchaseParam = new NBaseSDK.NBase.TrackingParameter( status: true, productId: "P12345", // 商品 ID paymentId: "google", // google, apple, amazon, one ... orderId: "Ord1234", currency: "USD", price: 9.99, serverId: "Server1" ); NBaseSDK.NBase.trackEvent("purchases", purchaseParam, (status, error) => { Debug.Log("[Unity] trackEvent...ok " + status); if (error != null) { NBaseSDK.NBase.showToast(error.Message.ToString()); return; } NBaseSDK.NBase.showToast(status.ToString()); }); ``` | Name | Type | Description | Required | | --- | --- | --- | --- | | productId | string | 商品 ID | Y | | paymentId | string | google, apple, amazon, one | Y | | orderId | string | 購入に対するレシート番号 | Y | | currency | string | 通貨単位 | Y | | price | double | 購入価格 | Y | | serverId | string | サーバ ID | N | - SDKは、OS、アプリのバージョンなどの有用な情報でイベントを自動的に向上させます。 - サーバに自動で送信されるログを直接管理できます。この SDKは自動的にイベントを追跡しません。手動で trackEventを呼び出す必要があります。そのため、一般的に、少なくともアプリの起動時にイベントを追跡することをお勧めします。 - trackEvent関数はバッググラウンドでは実行されません。 - ユーザー定義属性には文字列と数字のみ使用できます。