Analytics

connector.analytics provides methods for logging various analytics events such as events, purchases, ad revenue, and updating user or screen information. It acts as an interface for managing and processing analytics data through a connected analytics service.

Supported Analytics Platforms

The analytics interface currently supports event logging for the following platforms:

  • Adjust
  • Facebook Pixel
  • Firebase
  • Google Analytics
  • Yandex Metrika

Adjust Configuration

Adjust is integrated into the analytics framework using a configuration file (e.g., ). This file defines critical parameters such as app tokens, and event mappings:

    "token": "6dh55t109vr4",
    "purchaseToken": "6gffsu",
    "events": {
        "levelup": "r5df4a",
        "visit": "gftdsa",

Yandex Metrika Configuration

Yandex Metrika is also integrated into the framework using configuration details typically provided as part of a larger file. It includes the Yandex Metrika counter ID alongside other settings:

   "yandex": {
        "appId": "453265",
        "counter": 365854621
    },

Methods

(static) logEvent(name, params)

Logs an event with the specified name and parameters.

Parameters:
NameTypeDescription
namestring

The name of the event to be logged.

paramsObject

An object containing key-value pairs of parameters associated with the event.

(static) logPurchase(product, purchase, paramsopt)

Logs a purchase event with the provided product, purchase, and additional parameters.

Parameters:
NameTypeAttributesDescription
productObject

The product information related to the purchase.

purchaseObject

The details of the purchase being logged.

paramsObject<optional>

Additional parameters for logging the purchase (optional).

(static) logAdRevenue(name, impressionCost, params)

Logs advertisement revenue data.

Parameters:
NameTypeDescription
namestring

The name or identifier of the advertisement.

impressionCostnumber

The cost per impression of the advertisement.

paramsObject

Additional parameters or metadata associated with the advertisement.

(static) onUpdateUserId()

Sends user information, including the updated user ID, to Firebase for analytics tracking.

(static) onUpdateScreen(screen, scene)

Handles the event of updating the screen and sends it to Firebase along with the specified screen and scene details for analytics processing.

Parameters:
NameTypeDescription
screenstring

The identifier of the screen being updated.

scenestring

The identifier of the scene associated with the screen.