React Tracking screenshot

React Tracking

Author Avatar Theme by Nytimes
Updated: 19 Jul 2023
1897 Stars

Declarative tracking for React apps.

Overview

React-Tracking is a specialized library designed for tracking events within React applications, and it comes equipped with a range of tools to facilitate robust data tracking without complicating your component structure. Whether you’re an experienced developer or just beginning, this library allows you to compartmentalize tracking concerns, making it easier to manage and maintain.

With React-Tracking, you can take advantage of both higher-order components and React Hooks, ensuring you have the flexibility to implement tracking in the way that best fits your application. This library promotes an expressive and declarative approach, all while being analytics platform agnostic.

Features

  • Higher-Order Component and Hook Support: Utilizes both higher-order components and React Hooks, allowing for versatile integration into your components.
  • Compartmentalized Tracking: Keeps tracking logic contained within specific components to prevent data leakage across your application.
  • Expressive API: Offers a blend of imperative and declarative options for adding tracking, catering to various coding styles and preferences.
  • Tracking Data Handling: Accepts tracking data that can be defined at the component level, making it highly adaptable to different use cases.
  • Custom Dispatch Functionality: Allows the use of custom dispatch behavior, providing greater control over how tracking events are managed.
  • Dispatch on Component Mount: Provides an option to automatically dispatch tracking data when the component is inserted into the DOM, simplifying initial tracking setup.
  • Contextual Tracking with <Track /> Component: The useTracking hook includes a <Track /> component for easily passing contextual data down to child components, enhancing the scope of your tracking.
  • Support for Deep Merging Options: The library’s mergeOptions feature enables deep merging of options, improving customization and flexibility.