Hi, is there a way to get the url of the previous page for page tracking purposes? window.document.referrer always points to the url in which the first page load occurred for subsequent client side page navigation.
Do you mean something like this?
https://github.com/zeit/next.js/blob/master/lib/router/router.js#L108
You can use Router.back() or you can even call window.history.back() like Router.back() does
Hey, @MFCo I would like to retrieve the url or pathname without navigating to the page. Do you know if that's possible?
@junshengpierre you need to implement it yourself, you can save each URL after the page changed in-memory, if you're using Redux you can dispatch an action and save the URL.
Most helpful comment
@junshengpierre you need to implement it yourself, you can save each URL after the page changed in-memory, if you're using Redux you can dispatch an action and save the URL.