Closed wootwoot1234 closed 4 years ago
You can fix it with a HOC:
In your Router files:
const withAnalytics = (Component) => (props) => {
FacebookPixel.pageView();
return <Component {...props} />;
};
// ...
<Route path='/signup' component={ withAnalytics(SignUp) } />
I implemented it in https://getnofilter.com and it's working
Do I need to call ReactPixel.pageView(); every time a page loads? If so do I call it in componentDidMount()? Is there a way to call it on each route change if I'm using "react-router-dom"?