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.
Name | Type | Description |
---|---|---|
name | string | The name of the event to be logged. |
params | Object | 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.
Name | Type | Attributes | Description |
---|---|---|---|
product | Object | The product information related to the purchase. | |
purchase | Object | The details of the purchase being logged. | |
params | Object | <optional> | Additional parameters for logging the purchase (optional). |
(static) logAdRevenue(name, impressionCost, params)
Logs advertisement revenue data.
Name | Type | Description |
---|---|---|
name | string | The name or identifier of the advertisement. |
impressionCost | number | The cost per impression of the advertisement. |
params | Object | 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.
Name | Type | Description |
---|---|---|
screen | string | The identifier of the screen being updated. |
scene | string | The identifier of the scene associated with the screen. |