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:
<script type="text/javascript">
var myinput = `$$input:referrer$$`;
myinput= myinput .replace(/text/g, "hidden");
myinput= myinput .replace(/<input/g, "<input value='" + document.referrer + "'");
document.write(myinput);
</script>
N.B. $$input:referrer$$ is wrapped in backticks to allow mulitline string in javascript
P.S. you should get something like this.