Wix 404 Routing / Catch all

Dear Wix Team, Wix Users, Coders,

We are using s********e at the moment but I want to change to wix. Sadly I am missing one crucial part here to acomplish what we need.

I am writing you regarding something I try to accomplish. I actually wanted to use the 404-Site to execute some JavaScript. After a conversation with the Wix Support they told me I should ask my question here:

What I need, is to execute some sort of JavaScript to save a cookie on a Catch All Route if no site matches the web url.

Example: xy.com/awesomestring

I want to save awesomestring in a cookie.
Maybe you have an awesome idea for me, so I can finally change our sites to WIX.

Best,
Manuel

Then you must create a router that will check the sites structure and match if a page exists of the incoming request and if it does not store the incoming url in a data collection or where ever you want it stored. Look at site structure and routers, thats your best solution.