Developer Guide

React Native User Behaviour

Track Custom Events

Reteno SDK provides ability to track custom events.

import { logEvent } from 'reteno-react-native-sdk';

const eventName = 'EVENT_NAME';
const date = new Date().toISOString();
const parameters = [
    {
        name: 'Additional parameter',
        value: 'Additional value',
    }
];
const forcePush = false;

logEvent(eventName, date, parameters, forcePush);

The parameters list item structure:

type CustomEventParameter = {
  name: string;
  value?: string;
};

📘

Note

date

Date should be in ISO8601 format

forcePush is iOS-only feature; Please read more about it here

Log Screen View Events

You can send screen view events using logScreenView function:

function logScreenView(screenName: string): Promise<void>;

There are a few ways to implement the navigation within React Native apps, therefore there is no "one fits all" , this function provides a basic mechanism for sending screen view events, and you can use it whatever way you want.

const someRouteName = getSomeRouteName();
await logScreenView(someRouteName);

You can check an example provided by React Navigation library, which can give you an idea of the implementation. See Screen tracking for analytics documentation.

📘

Note

Set up event-based segmentation to ensure custom events and their parameters are recorded in contact cards, enabling the creation of dynamic segments.