your macro is not resolved correctly, but there is a tutorial: capture Referring URL on form postback
You may also try a quick way without going through all the complexity of creating form controls for hidden inputs and macros:
- Generate your form layout with submit button.
- Create new text field called 'referrer' and make it not required.
Go back to form layout, switch to source and add:
var myinput = `$$input:referrer$$`;
myinput= myinput .replace(/text/g, "hidden");
myinput= myinput .replace(/<input/g, "<input value='" + document.referrer + "'");
P.S. you should get something like this.