Refactor usage of googleAnalytics hook #612
Labels
brightlayer-ui
Used to identify Brightlayer UI platform issues for easy filtering
enhancement
Request for improvement or new feature
Describe the desired behavior
Move the useGoogleAnalytics hook from every page to the router so we don't need to use the GA hook on every page
Describe the current behavior
useGoogleAnalytics hook is being called on every page
Is this request related to a current issue?
Additional Context
In doc-it, the useGoogleAnalytics hook is used on each page (or in the markdown page wrapper component) to call GA with 'pageviews'. This works fine. Dev-docs is configured so that we don't need to do this on every page, we can actually just have it in one place in a useEffect hook in the router (any time the route changes, we trigger a page view).
The text was updated successfully, but these errors were encountered: