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");

1 comment:

Anonymous said...

just remember that it cannot be taken for granted. Anonymous navigation often prevents the browser from filling that header.
Just to say that getting no referrer at all doesn't mean one keyed the url in the url bar for sure.

Post a Comment

 

This content comes from a hidden element on this page.

The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.
Click me, it will be preserved!

If you try to open a new ColorBox while it is already open, it will update itself with the new content.

Updating Content Example:
Click here to load new content