Try to inspect your code by your own. How?
For example you can check, if the issue is your —> LOCATION-TO-PART in your code.
Take a working site-url → for example —> https://www.google.com and replace it with yours.
wixLocation . to ( " https://www.google.com " );
Now take a look at the function of your code. Does it now work with the new URL ?
If → YES —> You found your problematic code-part.
If → NOT → Continue searching using CONSOLE-LOG.
Your code consists of just 5-codelines. I am sure you will be able to solve your issue by your own.