Hive SDK Client Type
Hive SDK enables to directly send the log formatted that client requires to the Hive log collecting server.
Unity®
1 2 3 4 5 |
JSONObject logData = new JSONObject (); // Sets pre-defined log logData.AddField ("category", "hivesdk_levelup_log"); logData.AddField ("level", level); Analytics.sendAnalyticsLog (logData); |
C++
1 2 3 4 5 |
picojson::object logData; // Sets pre-defined log logData["category"] = picojson::value("hivesdk_levelup_log"); logData["level"] = picojson::value((double)level); Analytics::sendAnalyticsLog(logData); |
Android
1 2 3 4 5 |
Map<String, Object> logData = new HashMap<String, Object>(); // Sets pre-defined log logData.put("category", "hivesdk_levelup_log"); logData.put("level", level); Analytics.sendAnalyticsLog(logData); |
iOS
1 2 3 4 5 |
NSMutableDictionary* logData = [[NSMutableDictionary alloc] init]; // Sets pre-defined log [logData setObject:@"hivesdk_levelup_log" forKey:@"category"]; [logData setObject:level forKey:@"level"]; [HIVEAnalytics sendAnalyticsLog:logData]; |
Sending Funnel Log on Entry Section of Game
From game implementation to access to game lobby, Hive SDK sends logs by section to Hive Analytics in order to analyze the point where users leave games.
When applying SDK v4.11.0 or later, logs will be sent automatically up to large banner Hive promotion (1,000), and you can check the default created funnel or create a new funnel by going to Hive Console > Analytics > Funnel Menu. For instructions on creating a funnel in the console, go to Analytics > Funnel Page.
-
- Entry Section Value List
User inflow records are logged in the entry section below. Funnel logs are recorded once each time the app is run by each user. Based on the Guideline for Game Flow, you can check whether users are leaving in the section specified below.Category Entrance Section Description Predefined Section 400 the app installation 401 the starting point of the Hive SDK initialization 420 Update/Notice 430 Terms of service agreement 500 game server manual selection 600 game server maintenance popup 700 the start of downloading game data and resources (different from game installation/update) 800 the end of downloading game data and resources 900 login 1000 Full banner Hive Promotion User-defined Section 10,000 – 19,999 Game-defined Section
- Entry Section Value List
- Transmit game data, resource download sections and user-defined section logs
It is difficult to accurately determine the start and end point of the game data, resource download section and user-defined section in Hive SDK, and the user’s log must be transmitted by specifying the start and end point in the game. Try sending logs using the sample code below.
Unity®
1 2 3 4 5 6 7 8 9 10 11 |
// 700 at the start of downloading game resources and data Analytics.sendUserEntryFunnelsLogs("700", null); // 800 when resource and data download complete Analytics.sendUserEntryFunnelsLogs("800", null); // When using Analytics.sendAnalyticsLog() JSONObject logData = new JSONObject(); // 700 at the start of game resource and data download logData.AddField("category", "hive_user_entry_log"); logData.AddField("sectionId", 700); Analytics.sendAnalyticsLog(logData); |
C++
1 2 3 4 5 6 7 8 9 10 11 |
// 700 at the start of downloading game resources and data Analytics::sendUserEntryFunnelsLogs("700", nullptr); // 800 at the end of downloading game resources and data Analytics::sendUserEntryFunnelsLogs("800", nullptr); // When using Analytics::sendAnalyticsLog() picojson::object logData; // 700 at the start of game resource and data download logData["category"] = picojson::value("hive_user_entry_log"); logData["sectionId"] = picojson::value((double)700); Analytics::sendAnalyticsLog(logData); |
Android
1 2 3 4 5 6 7 8 9 10 11 |
// 700 at the start of downloading game resources and data Analytics.sendUserEntryFunnelsLogs("700", null); // 800 at the end of downloading game resources and data Analytics.sendUserEntryFunnelsLogs("800", null); // When using Analytics.sendAnalyticsLog() Map<String, Object> logData = new HashMap<String, Object>(); // 700 at the start of game resource and data download logData.put("category", "hive_user_entry_log"); logData.put("sectionId", 700); Analytics.sendAnalyticsLog(logData); |
iOS
1 2 3 4 5 6 7 8 9 10 11 |
// 700 at the start of downloading game resources and data [HIVEAnalytics sendUserEntryFunnelsLogs:@"700" withOptions:nil]; // 800 at the end of downloading game resources and data [HIVEAnalytics sendUserEntryFunnelsLogs:@"800" withOptions:nil]; // When using HIVEAnalytics sendAnalyticsLog NSMutableDictionary* logData = [[NSMutableDictionary alloc] init]; // 700 at the start of game resource and data download [logData setObject:@"hive_user_entry_log" forKey:@"category"]; [logData setObject:700 forKey:@"sectionId"]; [HIVEAnalytics sendAnalyticsLog:logData]; |