Wednesday, October 7, 2009

How can we track from where user started to access your Web Application?

Most of the time we want to know from where the user started to trigger our URL, most of the time it will via of google.com. It terms of marketing a product its very important to know how the URL was triggered...I was think the only way is to add the reference as a request parameter, but there is also another option is available in HTTP header fields.

Referer Header Field:

This field in the header object will give you the web page URL from which you application was triggered.
Below code in java will give you the reference URL.


String refUrl = request.getHeader("referer");

No comments: