react-metrics
react-metrics copied to clipboard
Add support to pass target element with track call
Hi i submitted a PR which will pass the click element along with the track call. This is useful to us as we can default a lot of track metadata based on the type of element.
@mmairs9 we were having this issue too and ended up developing a more flexible api (we think) and even though your PR is years old, I wanted to post it here for posterity: https://github.com/stackshirts/react-capture-metrics
Basically you can pass whatever event data you want to analytics.track(name, {...props}).