My goal: send information to Google Analytics (GA) regarding which page a user tried to reach when he/she lands on my 404 error page.
Currently, I am already sending events to GA when someone lands on my 404 page. But it would be helpful to add the complete URL the user tried to reach to the payload. Currently, the wixLocation.url variable always return “error404” on the 404 page, even though on my browser URL bar I have a different URL .
If you have a premium account, you can create a 404 page of your own,
and you can try adding some code to retrieve the page url (wixLocation) and save it to the database (I’ve never tried to do it, but I don’t see a reason why wouldn’t it work).
Maybe it’s not clear on my post. This is exactly what I have. But the problem I am facing is the behavior of the wixLocation library. The wixLocation.url always return the same value (“error404”) for any wrong URL my customer may type.
In other words, there is no way for me to know what did my customers typed wrongly because the wixLocation.url always return the same “error404” string instead of the actual URL the customer typed.