Skip to content

Analytics module

A module that turns events that occur in the app client into logs and sends them to the Hive Axyl analytics log server. It sends multiple log events in a single request.

Module information

  • Package: com.com2usplatform.hiveaxyl.analytics
  • Namespace: Hive.Axyl.Analytics
  • Supported platforms: All (server API)
  • Minimum requirements: Unity 6000.0+

Provided interfaces

Interface Registration method Description
IAnalyticsService AddAnalytics() Client log event sending

For how the feature is organized, see Analytics.

Registration and retrieval

Register it with AddAnalytics() in the registration step of HiveBootstrap.Initialize, and then retrieve it with HiveCore.Resolve<T>().

using Hive.Axyl.Core;
using Hive.Axyl.Core.Unity;   // HiveBootstrap
using Hive.Axyl.Analytics;

var config = CoreConfig.CreateBuilder("{appId}").Build();

HiveBootstrap.Initialize(config, builder =>
{
    builder.AddAnalytics();
});

IAnalyticsService analytics = HiveCore.Resolve<IAnalyticsService>();

The methods of IAnalyticsService do not require a login session, so logs are sent both before and after login. After a login session is activated, the SDK automatically includes the session's authentication token in requests.

For the installation procedure and initialization, see Install and initialize the module.