How Can I Determine Where a User Has Come From?

0
7
Asked By CuriousCat123 On

Hey everyone! I've been trying to figure out how to find out the website a user visited before arriving at mine. I came across a discussion on this topic where someone mentioned using the "Referer" parameter. However, when I tried testing it in the console after clicking a link, it returned an empty string. According to the documentation, it shouldn't be empty, so I'm a bit confused. Does anyone have insights on how this actually works?

5 Answers

Answered By WebMasterJake On

When you say you 'entered this link', did you just change the URL directly in your browser? If so, the referrer will be blank since that action doesn't carry over a referer. The header is only sent when a link on another site is clicked to navigate to yours. Also, external sites can block the referrer via the referrer policy, so it can be hit or miss.

Answered By CodeWizard88 On

To track where users are coming from, you want to look at the "Referer" header. Check out the MDN documentation for more details here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Referer

TechGuru101 -

Oh, just a heads up! The misspelling of "referer" is actually part of the web specs from a long time ago. Makes for some confusion for newcomers!

Answered By AnalyzerSam On

You're looking for the referer website or page, and that's standard in analytics tools. Google Analytics and others show this info too. But just remember, you can pull it directly from the request header without using any analytics, but it is optional, so not all sites will provide it.

Answered By NetSecNerd On

Checking the Referer header is a good start, but keep in mind that it's not very reliable since browsers block it in certain situations for security reasons. This is usually a good measure to protect user privacy.

Answered By SkepticalSteve On

Boooo! Sounds complicated!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.