views:

485

answers:

1

I need to test whether or not a click-through is valid by using some javascript client-side tests (e.g., browser window dimensions).

However, I would like the original click referrer to remain the same. Is there a way I can do a redirect, execute some javascript, capture the browser details and then continue the click-through while keeping the original referrer value the same?

A: 

If there isn't, then simply include the referrer as one of the "browser details" that you capture and send back with the redirection instruction. The referrer probably isn't available on the client automatically, so it will work like this:

  1. Client sends initial request, presumably including a referrer.
  2. Server dynamically generates the client-side-testing page, including the referrer in a Javascript variable.
  3. Client collects client attributes, including the referrer value stored in step 2.
  4. Client sends collected attributes to server with new redirection request.
  5. Server records referrer parameter somewhere, although not in the HTTP logs since the Referer header won't have the same value as what the Javascript request sent.

Of course, you realize none of this is reliable anyway because it all depends on the client including the Referer header in step 1, and there's no guarantee that will happen, or if it does happen, that the value you get is accurate. I also question the wisdom of doing client-side checks (especially of something as arbitrary as window dimensions) to determine the validity of a navigation request.

Rob Kennedy