If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > how to collect the number

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-22-04, 14:33
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
how to collect the number

I need to collect the number of the users who click on the banner on which there is a link, i.e.,

<a href="http://www.clientwebsite.com" target="_BLANK">
<img src="http://www.clientwebsite.com/images/banner.gif">
</a>

Please help.
Reply With Quote
  #2 (permalink)  
Old 07-22-04, 18:55
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
So basically you are talking about an onclick event that triggers a http post to yur system (to record the click) and then allows the link to function as normal yes??

Why don't you make the link reference a page on your side that records the click and then redirects to the actual link location/target?
Reply With Quote
  #3 (permalink)  
Old 07-22-04, 20:15
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
The client's banner is placed on our web pages. We need to know the number of clicks on the banner per month. I did the following way:

<SCRIPT language="JavaScript">
<!--
function saveClickNumber() {
<% Application("ClickNumber") = Application("ClickNumber") + 1 %>
}
//-->
</SCRIPT>

<a href="http://www.clientwebsite.com" target="_BLANK" onclick="javascript:saveClickNumber()">
<img src="http://www.clientwebsite.com/images/banner.gif">
</a>

But the question is when you refresh the page, the Application("ClickNumber") will be incremented by 2. I do not know how to do it correctly.
Reply With Quote
  #4 (permalink)  
Old 07-22-04, 20:17
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
err,.. with what you have done you are not recording the number of clicks you are recording the number of displays.....

Your trying to mix your client side scripts with your sever side scripts and that just doesn't really work...
Reply With Quote
  #5 (permalink)  
Old 07-22-04, 20:20
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
Any good idea? Thanks.
Reply With Quote
  #6 (permalink)  
Old 07-22-04, 20:25
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
The way it is normally done is something like this....

Page1 - displays whatever it is meant to as well as the banner. Clicking the banner links to page 2

Page2 - records the web click and redirects to the proper location for the banner

So your link becomes something like...

<a href="http://www.mywebsite.com/redirect.asp?loc=www.clientwebsite.com" target="_BLANK" >
<img src="http://www.clientwebsite.com/images/banner.gif">
</a>

In redirect.asp you have something like...

Application("BannerCount") = Application("BannerCount") + 1
Redirect("http://" & Request.QueryString("loc"))

Would that fit in with your solution requirements??
Reply With Quote
  #7 (permalink)  
Old 07-22-04, 20:48
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
Yes, it works. Thanks.
Reply With Quote
  #8 (permalink)  
Old 07-22-04, 20:51
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
No problems. You might have an issue with spaces in urls and escaping characters if you are trying to go to a specific page within a site instead of the default page, but can can get around all that with a few refinements to the general idea.
Reply With Quote
  #9 (permalink)  
Old 07-22-04, 21:11
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
I used Server.URLEnCode(url) instead of url. And also in redirect.asp page, I put IF statement to check the querystring in case someone hits the redirect.asp page.

Thank you again.
Reply With Quote
  #10 (permalink)  
Old 07-22-04, 21:12
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
that should cover most of it.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On