• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Track clicking of URL links

 
Mike Li
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
My servlet creates a page with a list of URL links to different web sites. I like to record the date and time when user clicks on any link. Any idea how should i do this?
Thanks!
Mike.
 
Matthew X. Brown
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could have the links posted back to a servlet on your site, where you record the date, time, and link hit, and then you use a RequestDispatcher to forward to the other site.
So when you reference google- your href is back to a servlet on your site that records the info, then forwards them to the new site.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without some sort of intervention, you will never know when a user clicks a link.
In order to track the click throughs, you will have to use JavaScript to send the new location to a servlet on your system, you can count it and then do a redirect to the correct URL. The cool thing to do would be to use a code in the Javascript link so the user could not look at the source and discover the real URL.
What an interesting idea .... I could use that.
Bill
(Come to think of it Javascript is not needed - I must be doing too much Javascript these days.)
[ October 24, 2002: Message edited by: William Brogden ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic