Collection of functions responsible for tracking user activity in an Eitri-App using the Optimove SDK (Optimove + Optimobile).

This module exposes user-activity tracking only. The wider Optimove integration also covers push notifications, but that has no dedicated bridge surface here: registration, receipt and deeplink routing are wired natively. In-app messaging is not integrated.

Requirements: This feature must be enabled in the Eitri Shopping App native configuration by providing the optimove configuration (Optimove SDK credentials and Optimove Mobile credentials) in the app configuration file.

User identity is not set here, but in session.notifyLogin and session.notifyLogout.

Optimove receives only the identity part of the login payload, because its SDK has no public API for profile attributes:

  • customerId becomes the Optimove SDK ID (user identifier).
  • email, when present and not blank, is registered together with the SDK ID. Without it, only the SDK ID is set.
  • Every other NotifyLoginInput field (phone, name, first_name, last_name, birthday, gender, address fields) and the extras bag are not sent to Optimove. Customer profile data is expected to reach Optimove through the brand's server-side data integration, keyed by the same customerId.

On session.notifyLogout the SDK has no way to clear the user identifier, so the install reverts to an anonymous visitor until the next login.

Events sent through tracking.logEvent already reach Optimove along with every other configured provider. Use logEvent here only when an event is meant for Optimove alone.

Methods

  • Logs an event with the Optimove SDK, where each parameter of the event is defined as a key-value pair within the data object.

    Supported value types for the data object are: string, number, and boolean.

    The eventName and the keys of data are passed to the Optimove SDK verbatim. Custom events must be declared in your Optimove tenant configuration before they are accepted, and event reporting requires the OptiTrack feature to be enabled for the tenant.

    Example:

    const modules = await Eitri.modules();
    const logEvent = modules?.optimove?.logEvent;
    if (!logEvent) return;

    await logEvent({
    eventName: "product_view",
    data: {
    revenue: 29.99,
    currency: "BRL",
    productId: "sku-001"
    }
    })

    Parameters

    • param: { data: Record<string, string | number | boolean>; eventName: string }

      Object describing the event.

      • data: Record<string, string | number | boolean>

        Object describing the event's data. Values must be primitives (string, number, or boolean).

      • eventName: string

        Name of the event.

    Returns Promise<undefined>

  • Reports a screen visit to the Optimove SDK.

    Optimove models screen visits as a dedicated event type rather than a custom event, so this has no equivalent in tracking.logEvent and is the only way to record one.

    Example:

    const modules = await Eitri.modules();
    const reportScreenVisit = modules?.optimove?.reportScreenVisit;
    if (!reportScreenVisit) return;

    await reportScreenVisit({
    screenTitle: "Account creation",
    screenCategory: "Accounts"
    })

    Parameters

    • param: { screenCategory?: string; screenTitle: string }

      Object describing the screen visit.

      • OptionalscreenCategory?: string

        Optional category the screen belongs to. Omitted when absent or blank.

      • screenTitle: string

        Title of the visited screen. Required; an empty value is rejected.

    Returns Promise<undefined>