Collection of functions responsible for tracking an user's activity in an Eitri-App using various services.

Methods

  • Registers an event in AppsFlyer

    trackingLogEvent = async () => {
    try {
    const modules = await Eitri.modules();
    const logEvent = modules?.appsFlyer?.logEvent;
    if (!logEvent) return;
    await logEvent({eventName: "eitri_event", data: { page: "/Playground"}})
    } catch (error) {
    console.log("appsFlyerLogEvent.error: ", error);
    }
    }

    Parameters

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

      Object describing the event.

      • data: Record<string, string | number>

        Object describing the event's data.

      • eventName: string

        Name of the event.

    Returns Promise<undefined>

  • Sets the customer user id in AppsFlyer

    setCustomerUserId = async (customerUserId: string) => {
    try {
    const modules = await Eitri.modules();
    const setCustomerUserId = modules?.appsFlyer?.setCustomerUserId;
    if (!setCustomerUserId) return;
    await setCustomerUserId({customerUserId})
    } catch (error) {
    console.log("appsFlyerSetCustomerUserId.error: ", error);
    }
    }

    Parameters

    • param: { customerUserId: string }

      Object describing the customer user id.

      • customerUserId: string

        The customer user id to associate with AppsFlyer.

    Returns Promise<undefined>