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
).<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");
Tracking Events Manually with Airbridge¶
- Get the required token. For more information on how to get a token, refer to the Airbridge Dashboard Guide.
- Get the App SDK Token and App Name from Dashboard > Settings > Token Management.
- Add the token, app name, and event settings to hive_config.xml according to the instructions below. Refer to the example code below.
- Airbridge provides SDK Signature to prevent app spoofing. You must check the agreement with Airbridge to use the related function. To use the related function, get a key and add it to
secretId
andsecret
in hive_config.xml. For more information about SDK signature security information, please refer to the Airbridge Guide. - Send events by calling the Analytics API sendEvent(). When sending events, use the `event name` added to hive_config.xml. `name` is used as a parameter when calling the API, and `value` can be checked in 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.<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
API Reference: Analytics::sendEvent
API Reference: Analytics.sendEvent
API Reference: AnalyticsInterface .sendEvent
API Reference: HIVEAnalytics:sendEvent