An event can be every activity that a user experiences in playing games, like game installation, update, and purchasing game items. If you collect the log of these events in your server, you can track and analyze users’ activity for multiple purposes. For example, you can predict user behaviors by tracking level-ups or item upgrades, and use the insights to make your game much more fun to play.
Marketing Attribution
Hive is available with Third–party Mobile App Attribution (MAA) which tracks user activities in your app. Third–party MAAs that Hive SDK provides are Adjust, Singular, Firebase Analytics, and AppsFlyer.
Activating Third–party Attribution
You can activate/deactivate Third–party Attribution with Hive API. To activate (or deactivate) the attribution, call setEnableTracker() function from Analytics API. Make sure to define the attribution one by one like the following format at the first parameter of this function.
- Adjust:
ADJUST
- Singular:
SINGULAR
- AppsFlyer:
APPSFLYER
- Firebase:
FIREBASE
The following example codes illustrates how to deactivate a marketing attribution.
API Reference: hive.Analytics.setEnableTracker
1 2 3 4 5 |
using hive; String trackerName = "ADJUST"; Analytics.setEnableTracker(trackerName, false); |
API Reference: Analytics::setEnableTracker
1 2 3 4 5 6 7 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; string trackerName = "ADJUST"; Analytics::setEnableTracker(trackerName, false); |
API Reference: Analytics.setEnableTracker
1 2 3 4 5 |
import com.hive.Analytics val trackerName = "ADJUST" Analytics.setEnableTrackerWithName(trackerName, false) |
API reference : : com.hive.analytics.SetenableTracker
1 2 3 4 5 |
import com.hive.Analytics; String trackerName = "ADJUST"; Analytics.INSTANCE.setEnableTrackerWithName(trackerName, false); |
API Reference: AnalyticsInterface.setEnableTracker
1 2 3 4 5 |
import HIVEService let trackerName = "ADJUST" AnalyticsInterface.setEnableTracker(name: trackerName, enable: false) |
API Reference: HIVEAnalytics:setEnableTracker
1 2 3 4 5 |
#import <HIVEService/HIVEService-Swift.h> NSString *trackerName = @"ADJUST"; [HIVEAnalytics setEnableTrackerWithName: trackerName enable: NO]; |
Use Steam Appsflyer
To use Steam Appsflyer on Windows environment, please follow the instructions below.
- Download Appsflyer (Steam).
- Unzip the downloaded file.
- Put the Appsflyer.dll under the {GAME_APP_EXECUTION_FILE_PATH}/plugins/trackers.
Automatic Event Tracking
Hive SDK can automatically track the following 4 events and send them to each attribution: Install, Open, Update, Purchase (in-app purchase) The game studio doesn’t need to implement codes to track these 4 events.
Automatic Event Tracking with Adjust
- Get the required tokens from each attribution. Refer to the Adjust dashboard guide to learn how to get the tokens.
- To track Purchase and Update event automatically, register these events on Adjust dashboard, and get the app token and the event tokens. The app token can be obtained on the dashboard main page, and the event tokens on Dashboard > All Settings > Events.
- For the automatic tracking of Install and Open events, no token is required.
- Add tokens on hive_config.xml.
- Add the app token, the event token of Purchase, and the event token of Update on hive_config.xml. For more details, see the example codes below.
- For the automatic tracking of Install and Open events, configuring hive_config.xml is not required.
- The Adjust dashboard provides SDK Signature V3 for app spoofing prevention. To use the SDK Signature, you must review the contractual terms with Adjust.
SDK signature integration
If you have used an older version of the SDK Signature, please check the SDK Signature migration before integrating the signature library. If you are using the SDK Signature for the first time, follow the instructions below.
Android
To use the SDK Signature in the Android environment, follow these instructions.
- Copy the adjust-android-signature-xxxxxx.aar library included in the SDK/External folder and add it to the project libs folder.
- Navigate to the Adjust dashboard and follow the instructions on the digital certificate fingerprint addition to Adjust’s allowlist page to set up the fingerprints. You can verify the fingerprints by referring to the certificate setup page in the Adjust suite, following the certificate method used in your app.
iOS
To use the SDK Signature in the iOS environment, add the ProviderAdjust
subspec to your Podfile.
1 2 3 4 5 6 |
(omitted) pod 'HiveAnalyticsProviderAdjust', $HIVE_SDK_VERSION pod 'HiveAnalyticsProviderAdjust/SignatureV3', $HIVE_SDK_VERSION (omitted) |
Unity
Select Hive – Hive Dependencies (ExternalDependency) from the menu and enable Adjust Signature V3.
Checking SDK signature integration status
To verify that the SDK Signature signing library is properly integrated, the zone
in the Hive SDK settings must be set to sandbox
. Then, follow the steps below.
- Completely uninstall the app from the test device to ensure that installation information is sent.
- Go to the Adjust dashboard testing console, enter the test device information, and click Delete Device to remove all entries.
- Install the app on the test device and run it to send installation information to Adjust.
- Enter the advertising ID or IDFA of the test device in the testing console to retrieve the installation event information.
- The
SignatureVerificationResult
field should display the valueValid Signature
. - Verify that the
SignatureVersion
field value is3
.
- The
SDK signature migration
To use the latest SDK Signature, you need to remove the settings for the previous SDK Signature version.
Android, iOS
Remove all keys and values set for secretId
, info1
, info2
, info3
, and info4
in the Adjust-related settings in hive_config.xml.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<providers> <!-- (code omitted) --> <!-- Do not set the id field for the Adjust node. --> <!-- The name field for the Adjust node is fixed as "Adjust." --> <!-- The name field for the event node is set arbitrarily by the game company. --> <!-- Remove secretId="1" info1="5432112345" info2="334123" info3="555333" info4="111333" below --> <Adjust name="Adjust" id="unused" key="APP_TOKEN" secretId="1" info1="5432112345" info2="334123" info3="555333" info4="111333"> <events> <event name="Purchase" value="PURCHASE_EVENT_TOKEN" /> <event name="Update" value="UPDATE_EVENT_TOKEN" /> </events> </Adjust> <!-- (code omitted) --> </providers> |
Unity
Select Hive – Edit Config from the menu, then activate the Android or iOS tab. Next, delete all values set in Adjust > App Secret Value for secretId, info1 ~ info4.
Automatic Event Tracking with Singular, Appsflyer, Firebase Analytics
- Get the required keys from each attribution dashboard. Refer to the guide from each attribution dashboard to learn how to get the keys.
- Singular: Get SDK Key and SDK SecretKey from the dashboard.
- Appsflyer: Go to AppsFlyer Configurations > App Settings to get Dev key.
- Firebase Analytics: No key is required.
- Configure hive_config.xml following the guide below. For more details, see the example codes below.
- Install: No configuration is required.
- Open: You only need to configure for Firebase Analytics.
- Update: You need to configure for all attributions: Singular, Appsflyer, Firebase Analytics
- Purchase: You need to configure for Singular and Firebase Analytics.
- If you use AppsFlyer attribution with Hive SDK iOS (Native, Unity, Unreal), you need to set
itunseConnectAppId
for Apple AppID.
12345678910111213141516171819202122232425262728293031<providers><!-- Configure for Singular --><!-- The name field of the Singular node is fixed to "Singular." --><!-- The name and the value field of the event node are defined by each game studio. --><Singular name="Singular" id="SDK_KEY" key="SDK_SECRET_KEY"><events><event name="Purchase" value="purchase"/><event name="Update" value="update"/></events></Singular><!-- Configure for AppsFlyer --><!-- The name field of the AppsFlyer node is fixed to "AppsFlyer." --><!-- Do not set the id field of the AppsFlyer node. --><!-- The name and the value field of the event node are defined by each game studio. --><AppsFlyer name="AppsFlyer" id="unused" key="DEV_KEY" itunseConnectAppId="909923112"><events><event name="Update" value="Update"/></events></AppsFlyer><!-- Configure for Firebase Analytics --><!-- The name and the value field of the event node are defined by each game studio. --><firebase><events><event name="Purchase" value="purchase"/><event name="Open" value="open"/><event name="Update" value="update"/></events></firebase></providers>
The information sent on a purchase event
If you implement your game’s billing with the Hive IAP, the Hive SDK automatically sends the purchase event to the third party mobile app attributions. The information sent on each event is as follows.
EVENT NAME | PARAMETER | Remarks | |
---|---|---|---|
Adjust | Purchase |
|
|
Singular | __iap__ |
|
|
AppsFlyer | Purchase |
|
|
FirebaseAnalytics | Purchase |
|
|
Manual Event Tracking
Aside from Install, Open, Update, and Purchase (in-app purchase) which are tracked automatically by Hive SDK, you can manually track the necessary events you want. To do this, you need to register the event to the dashboard of each attribution. For example, you can track specific events like the completion of your game tutorial (TutorialComplete) or the completion of a mission objective (MissionClear). You should implement the manual event tracking after finishing setting up the automatic event tracking.
Manual Event Tracking with Adjust
- To track custom events manually, register the events on Adjust dashboard, and get the app token and the event tokens. The app token can be obtained on the dashboard main page, and the event tokens on Dashboard > All Settings > Events. Refer to the Adjust dashboard guide to learn how to get the tokens.
- Add the app token and the event token of each event on hive_config.xml. For more details, see the example codes below.
- To prevent app spoofing, Adjust dashboard offers SDK Signature. To use this feature, you need to check Adjust contract details. To use this feature, get the required keys and add them in hive_config.xml (
secretId
,info1
,info2
,info3
,info4
).
12345678910111213<providers><!-- (skipped) --><!-- Do not set the id field of the Adjust node. --><!-- The name field of the Adjust node is fixed to "Adjust." --><!-- The name field of the event node is defined by the game studio. But once it is set, it should be the same for the name field of all other marketing attributions for the sendEvent() request.--><Adjust name="Adjust" id="unused" key="APP_TOKEN" secretId="1" info1="5432112345" info2="334123" info3="555333" info4="111333"><events><event name="TutorialComplete" value="TutorialComplete_EVENT_TOKEN"/><event name="MissionClear" value="MissionClear_EVENT_TOKEN"/></events><!-- (skipped) --></Adjust></providers> - Call Analytics API sendEvent() to send the event. Use
event name
in hive_config.xml when you send an event. Thename
is used as a request parameter for sendEvent(), and thevalue
you set will be updated on the dashboard of each attribution.Analytics.sendEvent("TutorialComplete");
Analytics.sendEvent("MissionClear");
Manual Event Tracking with Singular, Appsflyer, Firebase Analytics
- Get the required keys from each attribution dashboard. Refer to the guide from each attribution dashboard to learn how to get the keys.
- Singular: Get SDK Key and SDK SecretKey from the dashboard.
- Appsflyer: Go to AppsFlyer Configurations > App Settings to get Dev key.
- Firebase Analytics: No key is required.
- Configure hive_config.xml following the guide below. For more details, see the example codes below. If you use AppsFlyer attribution with Hive SDK iOS (Native, Unity, Unreal), you need to set
itunseConnectAppId
for Apple AppID.
12345678910111213141516171819202122232425262728293031323334<providers><!-- Configure for Singular --><!-- The name field of the Singular node is fixed to "Singular." --><!-- The name field of the event node is defined by the game studio. But once it is set, it should be the same for the name field of all other marketing attributions for the sendEvent() request.--><!-- The value field of the event node is defined by the game studio. --><Singular name="Singular" id="SDK_KEY" key="SDK_SECRET_KEY"><events><event name="TutorialComplete" value="Tutorial Complete"/><event name="MissionClear" value="Mission Clear"/></events></Singular><!-- Configure for AppsFlyer --><!-- The name field of the AppsFlyer node is fixed to "AppsFlyer." --><!-- Do not set the id field of the AppsFlyer node. --><!-- The name field of the event node is defined by the game studio. But once it is set, it should be the same for the name field of all other marketing attributions for the sendEvent() request.--><!-- The value field of the event node is defined by the game studio. --><AppsFlyer name="AppsFlyer" id="unused" key="DEV_KEY" itunseConnectAppId="909923112"><events><event name="TutorialComplete" value="Tutorial Complete"/><event name="MissionClear" value="Mission Clear"/></events></AppsFlyer><!-- Configure for Firebase Analytics --><!-- The name field of the event node is defined by the game studio. But once it is set, it should be the same for the name field of all other marketing attributions for the sendEvent() request.--><!-- The value field of the event node is defined by the game studio. --><firebase><events><event name="TutorialComplete" value="TutorialComplete"/><event name="MissionClear" value="MissionClear"/></events></firebase></providers> - Call Analytics API sendEvent() to send the event. Use
event name
in hive_config.xml when you send an event. Thename
is used as a request parameter for sendEvent(), and thevalue
you set will be updated on the dashboard of each attribution.Analytics.sendEvent("TutorialComplete");
Analytics.sendEvent("MissionClear");
Send an event via sendEvent()
It is recommended to send tracking event to the attribution only when user activities meet the specific conditions, such as tutorial completion. Call sendEvent()
method in the Analytics class to send the tracking event. As the first parameter of sendEvent()
, input the value of name
property from <event>
element, which is defined in hive_config.xml file.
Followings are sample codes sending TutorialComplete event to a marketing attribution to inform that a user has completed a tutorial.
API Reference: hive.Analytics.sendEvent
1 2 3 4 5 |
using hive; String eventName = "TutorialComplete"; Analytics.sendEvent(eventName); |
API Reference: Analytics::sendEvent
1 2 3 4 5 6 7 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; string eventName = "TutorialComplete"; Analytics::sendEvent(eventName); |
API Reference: Analytics.sendEvent
1 2 3 4 |
import com.hive.Analytics val eventName = "TutorialComplete" Analytics.sendEvent(eventName) |
API reference : : com.hive.analytics.sendevent
1 2 3 4 |
import com.hive.Analytics; String eventName = "TutorialComplete"; Analytics.INSTANCE.sendEvent(eventName); |
API Reference: AnalyticsInterface .sendEvent
1 2 3 4 5 |
import HIVEService let eventName = "TutorialComplete" AnalyticsInterface.sendEvent(eventName) |
API Reference: HIVEAnalytics:sendEvent
1 2 3 4 5 |
#import <HIVEService/HIVEService-Swift.h> NSString eventName = @"TutorialComplete"; [HIVEAnalytics sendEvent: eventName]; |
Send ad sales and exposure information
When an ad is displayed in a game, the type of advertising platform, ad placement location, exposure time, and ad revenue per exposure can be measured and sent to third-party attribution. To send this advertising revenue and exposure information, call the sendAdRevenueEvent()
function of the Analytics API. The following is the example codes for sending ad impression information to marketing attribution.
1 2 3 4 5 6 7 8 9 10 |
// Send ad sales measurement event to third-party attribution AnalyticsAdRevenue analyticsAdRevenue = new AnalyticsAdRevenue(); analyticsAdRevenue.revenue = 3.0; // advertising revenue analyticsAdRevenue.adPlatform = "AD Platform"; // ad network platform name analyticsAdRevenue.adUnitId = "Test Unit Id"; // ad unit ID analyticsAdRevenue.adType = "RewardedAD"; // Ad exposure type analyticsAdRevenue.adPlacement = "Test Rewarded AD"; // Ad exposure location analyticsAdRevenue.currency = "USD"; //currency code (ISO 4217 standard) Analytics.sendAdRevenueEvent(analyticsAdRevenue); |
1 2 3 4 5 6 7 8 9 10 |
// Send ad sales measurement event to third-party attribution AnalyticsAdRevenue analyticsAdRevenue; analyticsAdRevenue.revenue = 3.0; // advertising revenue analyticsAdRevenue.adPlatform = "AD Platform"; // ad network platform name analyticsAdRevenue.adUnitId = "Test unit id"; // ad unit ID analyticsAdRevenue.adType = "RewardedAD"; // Ad exposure type analyticsAdRevenue.adPlacement = "Test Rewarded AD"; // Ad exposure location analyticsAdRevenue.currency = "USD"; //currency code (ISO 4217 standard) Analytics::sendAdRevenueEvent(analyticsAdRevenue); |
1 2 3 4 5 6 7 8 9 10 |
// Send ad sales measurement event to third-party attribution AnalyticsImpl.AnalyticsAdRevenue analyticsAdRevenue = new AnalyticsImpl.AnalyticsAdRevenue(); analyticsAdRevenue.setRevenue(3.0); // advertising revenue analyticsAdRevenue.setAdPlatform("AD Platform"); // ad network platform name analyticsAdRevenue.setAdUnitId("Test Unit Id"); // ad unit ID analyticsAdRevenue.setAdType("RewardedAD"); // Ad exposure type analyticsAdRevenue.setAdPlacement("Test Rewarded AD"); // Ad exposure location analyticsAdRevenue.setCurrency("USD"); //currency code (ISO 4217 standard) com.hive.Analytics.INSTANCE.sendAdRevenueEvent(analyticsAdRevenue); |
1 2 3 4 5 6 7 8 9 10 |
// Send ad sales measurement event to third-party attribution var analyticsAdRevenue: AnalyticsImpl.AnalyticsAdRevenue = AnalyticsImpl.AnalyticsAdRevenue() analyticsAdRevenue.revenue = 3.0 // advertising revenue analyticsAdRevenue.adPlatform = "AD Platform" // Ad network platform name analyticsAdRevenue.adUnitId = "Test Unit Id" // Ad unit ID analyticsAdRevenue.adType = "RewardedAD" // Ad exposure type analyticsAdRevenue.adPlacement = "Test Rewarded AD" // Ad exposure position analyticsAdRevenue.currency = "USD" // Currency code (ISO 4217 standard) Analytics.sendAdRevenueEvent(analyticsAdRevenue) |
1 2 3 4 5 6 7 8 9 10 |
// Send ad sales measurement event to third-party attribution HIVEAnalyticsAdRevenue* adRevenue = [[HIVEAnalyticsAdRevenue alloc] init]; adRevenue.revenue = 3.0; // advertising revenue adRevenue.adPlatform = "AD Platform"; // ad network platform name adRevenue.adUnitId = "Test Unit Id"; // ad unit ID adRevenue.adType = "RewardedAD"; // Ad exposure type adRevenue.adPlacement = "Test Rewarded AD"; // Ad exposure location adRevenue.currency = ""; //currency code (ISO 4217 standard) [HIVEAnalytics sendAdRevenueEvent:adRevenue]; |
1 2 3 4 5 6 7 8 9 10 |
// Send ad sales measurement event to third-party attribution let analyticsAdRevenue = AnalyticsAdRevenue() analyticsAdRevenue.revenue = 3.0 // advertising revenue analyticsAdRevenue.adPlatform = "AD Platform" // Ad network platform name analyticsAdRevenue.adUnitId = "AD Unit Id" // Ad unit ID analyticsAdRevenue.adType = "AD Type" // Ad exposure type analyticsAdRevenue.adPlacement = "AD Placement" // Ad placement location analyticsAdRevenue.currency = "USD" // Currency code (ISO 4217 standard) AnalyticsInterface.sendAdRevenueEvent(analyticsAdRevenue) |
Ad exposure information
When sending ad exposure information, the information sent to third-party mobile app attribution is as follows.
Adjust | Singular | AppsFlyer | Firebase Analytics | |
---|---|---|---|---|
PARAMETER |
|
|
|
|
Reference: Properties by Service
Name | Description |
---|---|
name | Name of Thire-party Attribution. The same as the tag name.
|
id | The AppID of games issued from the Third-party Attribution dashboard
Example: |
key | The key of games issued from the Third-party Attribution dashboard
Example: |
secretId | A special element used for Adjust. For more details, check out Adjust contract details. |
info1 | A special element used for Adjust. For more details, check out Adjust contract details. |
info2 | A special element used for Adjust. For more details, check out Adjust contract details. |
info3 | A special element used for Adjust. For more details, check out Adjust contract details. |
info4 | A special element used for Adjust. For more details, check out Adjust contract details. |
itunseConnectAppId | Used in AppsFlyer (iOS) |
<event> Element Properties
Name | Description |
---|---|
name | The event name to be tracked enrolled in the Third-party Attribution dashboard Example: "TutorialComplete" |
value | The value of tracking event sending from Hive Client to the relevant attribution
Example: |