We want to track user navigation in a React app - clicks on buttons, form filling, page navigation.
What we don't want - to pollute every onClick etc handlers with custom analytics code.
Does react provides API for observing clicks / text typing in React components and route navigation?
PS We'd like to add custom attributes to the components to track analytics data, observer API should get us a back link to the component so we'll be able to extract meta-data.
We'd like to introduce analytics in declarative way instead of polluting code with custom JS logic.
The idea here is to set up a global event listener in your app, listening to the analyticsId of every element that you want to analyze.