Thanks to visit codestin.com
Credit goes to docs.logrocket.com

Track Custom Events (React Native)

Track custom information or user actions in your React Native app

Use the Custom Events API to track custom event measurements about your users' in-app behavior.

LogRocket.track() accepts a single String argument:

LogRocket.track('Registered');

You can then search for sessions containing these events using a Custom Event filter in the LogRocket Dashboard:

You can optionally provide a second Object argument containing properties that will be associated with the event:

LogRocket.track('PurchaseComplete', {
   revenue: 42.99,
   productCategory: 'Clothing',
   productSku: 4887369299,
   couponApplied: true,
   customerSegments: ['aef34b', '97cb20']
});

Properties may be of type boolean, integer, float, or string. Arrays of primitives (boolean, integer, float, or string) are also supported.

There are a few limits to keep in mind when providing properties to LogRocket.track():

  • Property names must be under 100 characters.
  • A maximum of 2000 properties may be uploaded per session. Properties over this limit will not be recorded.
πŸ“˜

'Revenue' Property

The 'revenue' property is a special property that you can use to pass data into our funnels. For more information, see here.