SDK 接入
客户端统一上报到 collect.gamezipper.comBatch API
curl -X POST https://collect.gamezipper.com/v1/batch \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"events": [
{
"event_name": "level_complete",
"player_id": "p_10001",
"install_id": "i_abc",
"session_id": "s_abc",
"platform": "ios",
"app_version": "1.0.0",
"country": "US",
"properties": {"level_index": 3}
}
]
}'
Unity SDK
// Attach GameZipperAnalytics.cs to a persistent GameObject.
// Configure collectUrl and apiKey in the Inspector.
var analytics = FindObjectOfType<GameZipperAnalytics>();
analytics.SetPlayerId("player_123");
analytics.Track("level_complete", new Dictionary<string, object>
{
{ "level_index", 3 },
{ "difficulty", "normal" }
});
analytics.Flush();
SDK includes persistent queueing, batch delivery, retry with backoff, and pause/quit flush hooks.