Conversions

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.

Parameters:
NameTypeDescription
namestring

The name of the event to be logged.

paramsObject | number

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.

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) trackAdRevenue(name, impressionCost, params)

Tracks 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) trackUserId()

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