Click to See Complete Forum and Search --> : Counter for a link


ozpo1
03-08-2006, 03:41 PM
I'm tring to count how many times a certian link is being clicked from a certain page. I'm using an application variables, but my problem is that I don't know how to make the counter count the click before it's moving to the next page.

For Example:
<a href="www.mywebsite.com/aboutus.htm"> about us</a>

The file is ASP of course, what is the code that I need to add the make it count the click on the same page? Thanks in advanced, Oz.

JayM
03-08-2006, 03:53 PM
What about something like this:

<a href="www.mywebsite.com/aboutus.htm" onclick="<% Call ClickCount %>"> about us</a>


Sub ClickCount

.....

End Sub


Cheers

ozpo1
03-08-2006, 05:31 PM
I received the following mistake:

Microsoft VBscript runtime error "800a000d"
Type mismatch: "clickcount"

in my global file I wrote the following functiion:

Sub ClickCount
Application("aboutus")= Application("aboutus")+1
End Sub

That's the code I used for my asp file:
<a class="sin" href="aboutus.htm" onclick="<%Call ClickCount%>" style="width:7em">

JayM
03-08-2006, 06:32 PM
Apparently the above doesn't work.

Here's the solution (http://www.codeave.com/asp/code.asp?u_log=8).

coding2006
03-09-2006, 11:40 AM
would the asp written for that link counter interfere with seach engines ability to read those links? I only ask because the link counter could be very useful but i do not want to blind search engines from spidering the web page.

JayM
03-09-2006, 11:55 AM
No it will not affect it at all coding2006. Go ahead and use it! :)

Cheers

coding2006
03-09-2006, 11:56 AM
thanks

JayM
03-09-2006, 12:14 PM
Anytime ;). Although you should be thanking the person who wrote the script :p.

Cheers