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 Thirdparty Mobile App Attribution (MAA) which tracks user activities in your app. Thirdparty MAAs that Hive SDK provides are Adjust, Singular, Firebase Analytics, and AppsFlyer.

Activating Thirdparty Attribution

You can activate/deactivate Thirdparty 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.

Unity®

API Reference: hive.Analytics.setEnableTracker

C++

API Reference: Analytics::setEnableTracker

Kotlin

API Reference: Analytics.setEnableTracker

Java

API reference : : com.hive.analytics.SetenableTracker

Swift

API Reference: AnalyticsInterface.setEnableTracker

Objective-C

API Reference: HIVEAnalytics:setEnableTracker

Use Steam Appsflyer

To use Steam Appsflyer on Windows environment, please follow the instructions below.

  1. Download Appsflyer (Steam).
  2. Unzip the downloaded file.
  3. 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

  1. 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.
  2. 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.
  3. 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).

Automatic Event Tracking with Singular, Appsflyer, Firebase Analytics

  1. Get the required keys from each attribution dashboard. Refer to the guide from each attribution dashboard to learn how to get the keys.
  2. 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.
  3. If you use AppsFlyer attribution with Hive SDK iOS (Native, Unity, Unreal), you need to set itunseConnectAppId for Apple AppID.

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
  • price
  • currency
  • orderId
  • pid
  • title
  • serverId
  • quantity
  • revenue
  • pid: product id
  • revenue: price * quantity
Singular __iap__
  • r
  • pk
  • pcc
  • pn
  • pc
  • pq
  • pp
  • market
  • server
  • psku
  • pvid
  • haid
  • r: revenue (price * quantity)
  • pk: order id
  • pcc: currency
  • pn: title
  • pc: Inapp_Item
  • pq: quantity
  • pp: price
  • market: google
  • server:serverId
  • psku: product id
  • pvid: Hive PlayerID
  • haid: Hive Analytics ID
AppsFlyer Purchase
  • af_price
  • af_currency
  • af_quantity
  • af_content
  • af_receipt_id
  • custsom_product_id
  • af_content_type
  • af_revenue
  • custsom_product_id: product id
  • af_content: product description
  • af_content_type: title
  • af_revenue: price * quantity
FirebaseAnalytics Purchase
  • price
  • currency
  • orderId
  • pid
  • title
  • serverId
  • quantity
  • revenue
  • pid: product id
  • revenue: price * quantity

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

  1. 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.
  2. Add the app token and the event token of each event on hive_config.xml. For more details, see the example codes below.
  3. 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).
  4. Call Analytics API sendEvent() to send the event. Use event name in hive_config.xml when you send an event. The name is used as a request parameter for sendEvent(), and the value 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

  1. Get the required keys from each attribution dashboard. Refer to the guide from each attribution dashboard to learn how to get the keys.
  2. 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.
  3. Call Analytics API sendEvent() to send the event. Use event name in hive_config.xml when you send an event. The name is used as a request parameter for sendEvent(), and the value 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.

Unity®

API Reference: hive.Analytics.sendEvent

C++

API Reference: Analytics::sendEvent

Kotlin

API Reference: Analytics.sendEvent

Java

API reference : : com.hive.analytics.sendevent

Swift

API Reference: AnalyticsInterface .sendEvent

Objective-C

API Reference: HIVEAnalytics:sendEvent

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.

Unity®

C++

Java

Kotlin

Objective-C

Swift

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
  • Ad Platform
  • Ad Unit Id
  • Ad Placement
  • Revenue
  • Currency
  • Ad Platform
  • Ad Unit Id
  • Ad Placement
  • Ad Type
  • Revenue
  • Currency
  • Ad Platform
  • Ad Unit Id
  • Ad Placement
  • Ad Type
  • Revenue
  • Currency
  • Ad Platform
  • Ad Unit Id (Ad Unit Name)
  • Ad Type (Ad Format)
  • Revenue (Value)
  • Currency

Reference: Properties by Service

Name Description
name Name of Thire-party Attribution. The same as the tag name.

  • "Adjust"
  • "Singular"
  • "AppsFlyer"
  • "Firebase"
id The AppID of games issued from the Third-party Attribution dashboard

Example: "5725"

key The key of games issued from the Third-party Attribution dashboard

Example: "ab7b08bdc812dc0c731a846b952a10d3"

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

  • Adjust: The event token
  • Singular: The event name
  • AppsFlyer: The event name
  • Firebase: The event name No space (blank) is allowed

Example: "TutorialComplete"