The referrer is the page URL that originally generated the request for the current page view or object.
The referrer is a field in the request header from a client. Most of the time the referrer is the value of this field. If the link is contained within a frame, most analytic tools will navigate through the frames to collect the referrer of the top-most page containing the frame. Also the original link may be redirected to another URL one or more times. Typically the redirecting server will maintain the original referrer so that rendered page will have the referrer URL of the page that started the sequence of requests. For log-based analytic tools, the referrer is the referrer value in the request header.