stevejboyer
stevejboyer

Reputation: 171

How do site analytics tools know the URL that visitors were referred from?

I'm building a rudimentary tracking tool for one of my sites, and I'm realizing that Google Analytics and my Squarespace site are aware of the URL that referred my visitors to my site.

For example, Squarespace's analytics can detect the exact URL of the pinterest pin that 3 of my visitors came from, which blog post referred 15 visitors to me, etc. How can my server possibly know who referred them to my site?

I'm a full stack .Net/C#/Javascript engineer and have no ideas. Thanks!

Upvotes: 1

Views: 130

Answers (2)

ChevCast
ChevCast

Reputation: 59183

There is an HTTP referrer header that is usually populated by default by your browser upon clicking links. It's possible to disable this as the browser is what chooses to include the header. You can make requests in a variety of other ways and leave that header blank, but clicking a simple link in a standard browser is pretty much always going to include the header.

(click for larger view)

Upvotes: 4

adam
adam

Reputation: 968

basically, when you click a link on a site, that site will send location(the URL) information to the destination page, which your server logs.

Upvotes: -1

Related Questions