Detecting visitors send to my website

Hi,

I used “Referrer URL IS https://mysite.com/ref.html?mref=1” for tracking visitors send by members.
and it worked great…

Now i use “Referrer URL IS https://mysite.com/?mref=1” and it does not work at all…

The file ref file contained some javascript and was basically transferring visitors to mysite.

uri = uri + document.location.search + referrer;

If i analyse the visitors and hover over the folders icons. The first folder has no referrer but the folders after the first they visited have?

Why does it only work when sending them to another file first??

Greetings