Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling web site

 
Paul Richards
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Folks
Here is my problem. I need to determine which web site called ours.
For example if the user did a search in yahoo.com and this provided a link to our website, how could I determine that the previous site was www.yahoo.com?
I need to do this for marketing reasons!!! They want to know who is coming to our site via which search engine.
cheers Paul
 
Brian Glodde
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at the "HTTP_REFERER" field in the HTTP headers via getHeader(String name) in the request object.
<%=req.getHeader("Referer")%>
 
Bosun Bello
Ranch Hand
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTTPRequest headers has the Referer header that you can check.
 
Paul Richards
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the replies
I have tried using your suggestion and using the following code
<%String url = new String();
url = request.getHeader("Referer");
System.out.println(url);%>
I actually got this
http://209.185.240.250/cgi-bin/linkrd?_lang=EN&lah=13ee0e019bbebffce9957610d0f949ac&lat=1017859774&hm___action=http%3a%2f%2fwww%2econfused%2ecom%2fpages%2findex%2ejsp%3fMediaCode%3 d122
as the url
This is not what I was quite expecting, have I done something wrong?
thanks in advance Paul
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic