connector.conversions provides methods for tracking various conversions events such as events, purchases, ad revenue, and updating user information. It acts as an interface for managing and processing analytics data through a connected analytics service.
Supported Conversions Platforms
The conversions interface currently supports event tracking for the following platforms:
- Adjust
- Facebook Pixel
- Firebase
- Google Analytics
- Yandex Metrika
Adjust Configuration
Adjust is integrated into the conversions 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
},
Example level up event usage:
connector.conversions.trackEvent(connector.EVENTS.CONVERSIONS.LEVEL_UP);
connector.conversions.trackEvent(connector.EVENTS.CONVERSIONS.EARN_SOFT, 100);
Methods
(static) trackEvent(name, params)
Tracks 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 or a single numeric value |
(static) trackPurchase(product, purchase, paramsopt)
Tracks 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) trackAdRevenue(name, impressionCost, params)
Tracks 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) trackUserId()
Sends user information, including the updated user ID, to Firebase for analytics tracking.