nfl / react-metrics

An analytics module for React
MIT License
615 stars 45 forks source link

Support react-router v4 #35

Open GiladShoham opened 7 years ago

GiladShoham commented 7 years ago

Hi, First thanks for this great library!

Is react-metrics supports react-router4?

If no is there any plan/timeline for this? If yes, is there anything special need to be done?

Thanks! Gilad

kylem038 commented 7 years ago

We recently took some time to try and implement react-metrics with react-router v4. We did hit an issue where pageviews did not appear to be behaving correctly. Here's a gif of our log. You can see as we route around it seems to cancel the previous pageview session as if it didn't succeed, then starts a new one.

GazzaHazza commented 6 years ago

Just wondering is there any progress on this at all?

jamsea commented 6 years ago

@GazzaHazza there are no plans for us to move to react-router 4, so unfortunately we're not working on supporting this in react-metrics. However we're 100% open for a pull request to support this 👍

potench commented 6 years ago

Started working on a PR for React 16 in #56, it also contains an upgrade to react-router 3.2. But I haven't tried to upgrade to react-router 4 yet. It might be a good first step to peek at #56 and help get these tests passing. After we land that we can look to upgrade to react-router 4.

breeny commented 6 years ago

@potench any update on that PR?

morgs32 commented 4 years ago

For anyone still having issues with this - we worked to develop a similar API and a solution compatible with react router v4 (any router really, including next/router). Worth considering react-capture-metrics.