Newbie - Be Gentle :)

Results 1 to 2 of 2

Thread: Newbie - Be Gentle :)

  1. #1
    Join Date
    Dec 1969

    Default Newbie - Be Gentle :)

    Good afternoon (at least it is here) everyone. I'm brand spanking new to ASP and am trying to immerse myself in it, but am having some difficulty completing an assignment and was hoping for some wisdom. I am involved in the redesign of a Web site, and the customer wants hidden counters implemented that will dump each hit on the main page into a text file. That part is complete. However, we also have a clickable image on the main page linking to another site, and we want to include a separate counter to track how many times the image is clicked on. The initial thought was simply to include the counter in with the load of the new page, but the problem is that you can link to the new page from a number of other places, so that particular strategy would result in an inaccurate count of image clicks. Is there any ASP event handler similar to JavaScript's onclick, or a way to integrate a Javascript onclick into the ASP page to provide an accurate tracking for the counter? Any and all feedback, wisdom, and/or insults are greatly appreciated. Thanks and have a great day!

  2. #2
    Join Date
    Dec 1969

    Default OnClick happens in browser... yes, you could capture it in the browser and cause something special to happen back on the server, but only by posting to the server.<BR><BR>How about a simple solution?<BR><BR>&#060;A HREF="intermediatePage.asp"&#062; &#060;IMG Src="advertisement.jpg"&#062; &#060;/A&#062;<BR><BR>And then the file:<BR><BR>***** intermediatePage.asp *********<BR>&#060;%<BR>&#039; how did we get here?<BR>referredBy = Request.ServerVariables("HTTP_REFERER")<BR>... write that "referredBy" value out to your log file...<BR>... close the log file of course ...<BR><BR>Response.Redirect "theRealAdPage.html"<BR>%&#062;<BR>*************** **<BR><BR>Alternatively, you could look at the HTTP_REFERER in the "readAdPage.asp" and only log the ones that match particular pages. Your choice. If you do that, though, then *YOU* have to have control of the realAdPage. This way, you can log the click-through and send the user off to any other site in the world.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts