Question

A simple enough question unspecific to any web programming language as most use the HTTP protocol and as such are able to retrieve and manipulate the referrer in the HTTP header.

An example:

I am on a webpage and see that the address bar displays example.com/index.php?user=John.

I click a link on the webpage which takes me to inemplum.com.

Say inemplum.com records traffic statistics including the HTTP referrers of its visitors, would this visit show up as example.com/index.php?user=John OR just example.com/index.php? Is this variable i.e. does it depend on the client and/or host OS, browser, language, firewall, etc.? This could perhaps complement the question title to CAN they be.

I know that every other segment can be passed; the protocol, domain, folder path (which in itself has implications) and filename, but this question is focused only on the query data and parameters used in the GET method.

Was it helpful?

Solution

From the tests that I have done on my end, local and across multiple servers, the parameters of the referring URL have all been passed to the HTTP_REFERER without any modifications to the servers, hacks, or the like. I did not cross-browser test this, however; I primarily use Firefox.

A reference from the PHP manual that might help:

'HTTP_REFERER' - The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.

If this is purely for analytic tracking, the owner of "inemplum.com" should be able to provide you with a set of custom parameters to append to the URL that would patch directly into their tracking software. For instance, Google Analytic's utm_source=example.com, or Piwik's pk_campaign=whatever.

In the event that "inemplum.com" is trying to do something with that data, simply pass the necessary parameters over via a standard GET by appending the parameters to the link. For example, inemplum.com/?user=Jon.

Hope that helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top