Looking for a way to track form fillouts by a unique id.

So I am stuck and looking for some community support because my brain hurts at this point. I know its been done before so hoping I can get a reply.

I need to create a unique page id for any of my pages that records into Gravity Forms when someone fills out the form. For example url.com/contactus would be the direct link but need to make it have an identifier such as url.com/contactus#123 and I would know that 123 belongs to John and he referred the person.

Hope this makes sense. Thanks in advance.