473,406 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Counting Clicks

Just looking for some ideas here.

What is the best way to count how many times an image has been clicked?

I have an image gallery on a site and want to count how many times each
image has been clicked (clicking pulls up the full size image in a window)
so that I know which are popular and which are not.

I though about wimply adding an extra field to the database which serves up
the image details, and incrementing a number by 1 each time a user clicks it
just before the image is served up. What are the chances of this falling
over if two people were to click the same image at the same time?

Any other ideas much appreciated.
Jul 22 '05 #1
14 1631
"Steven Burn" <so*******@in-time.invalid> wrote in message
news:u9**************@TK2MSFTNGP12.phx.gbl...
You could always parse the server log's for the image's GET request?


I wanted something that I would be able to use in an admin section of the
site. So the admin people can log in and be able to see which pictures get
the most and which get the least hits.

Only automatic way I can think of is by updating the DBs.
Jul 22 '05 #2
The DB is going to be the best way of doing it IMHO (just mentioned the site log's as an alternative)

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Keith" <@.> wrote in message news:OF**************@TK2MSFTNGP11.phx.gbl...
| "Steven Burn" <so*******@in-time.invalid> wrote in message
| news:u9**************@TK2MSFTNGP12.phx.gbl...
| > You could always parse the server log's for the image's GET request?
|
| I wanted something that I would be able to use in an admin section of the
| site. So the admin people can log in and be able to see which pictures get
| the most and which get the least hits.
|
| Only automatic way I can think of is by updating the DBs.
|
|
Jul 22 '05 #3
"Steven Burn" <so*******@in-time.invalid> wrote in message
news:O1**************@TK2MSFTNGP11.phx.gbl...
The DB is going to be the best way of doing it IMHO (just mentioned the
site log's as an alternative)


Thanks. What I suspected.
Jul 22 '05 #4
"Steven Burn" <so*******@in-time.invalid> wrote in message
news:O1**************@TK2MSFTNGP11.phx.gbl...
The DB is going to be the best way of doing it IMHO (just mentioned the
site log's as an alternative)


Drifting very slightly. I would like to use this same idea on an intranet
at work I developed.

We have a number of PDF documents launched from HTTP links. They don't open
in a popup, simply open in Adobe.

How could I catch the click and count it to the DB before it launches the
URL?
Jul 22 '05 #5
No problem

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Keith" <@.> wrote in message news:ub**************@TK2MSFTNGP11.phx.gbl...
| "Steven Burn" <so*******@in-time.invalid> wrote in message
| news:O1**************@TK2MSFTNGP11.phx.gbl...
| > The DB is going to be the best way of doing it IMHO (just mentioned the
| > site log's as an alternative)
|
| Thanks. What I suspected.
|
|
Jul 22 '05 #6
stream it to the client. This allows you to put in code to do whatever
http://www.darkfalz.com/1098

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Keith" <@.> wrote in message news:uO**************@TK2MSFTNGP12.phx.gbl...
Just looking for some ideas here.

What is the best way to count how many times an image has been clicked?

I have an image gallery on a site and want to count how many times each
image has been clicked (clicking pulls up the full size image in a window)
so that I know which are popular and which are not.

I though about wimply adding an extra field to the database which serves
up the image details, and incrementing a number by 1 each time a user
clicks it just before the image is served up. What are the chances of
this falling over if two people were to click the same image at the same
time?

Any other ideas much appreciated.

Jul 22 '05 #7
Thanks

I might be being dumb here, but:

When I place that code in an ASP document, all it does is list the raw file
contents in the browser. How can I modify it so it actually processes the
file based on it's type (ie. for a JPG/GIF drawm the image, for a PDF launch
the plugin etc.).

Thanks
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2*****************@tk2msftngp13.phx.gbl...
stream it to the client. This allows you to put in code to do whatever
http://www.darkfalz.com/1098

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Keith" <@.> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...
Just looking for some ideas here.

What is the best way to count how many times an image has been clicked?

I have an image gallery on a site and want to count how many times each
image has been clicked (clicking pulls up the full size image in a
window) so that I know which are popular and which are not.

I though about wimply adding an extra field to the database which serves
up the image details, and incrementing a number by 1 each time a user
clicks it just before the image is served up. What are the chances of
this falling over if two people were to click the same image at the same
time?

Any other ideas much appreciated.


Jul 22 '05 #8
you'll have to set the ContentType appropriately if you want the file to
"open"

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Keith" <@.> wrote in message news:Oq**************@TK2MSFTNGP12.phx.gbl...
Thanks

I might be being dumb here, but:

When I place that code in an ASP document, all it does is list the raw
file contents in the browser. How can I modify it so it actually
processes the file based on it's type (ie. for a JPG/GIF drawm the image,
for a PDF launch the plugin etc.).

Thanks
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2*****************@tk2msftngp13.phx.gbl...
stream it to the client. This allows you to put in code to do whatever
http://www.darkfalz.com/1098

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Keith" <@.> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...
Just looking for some ideas here.

What is the best way to count how many times an image has been clicked?

I have an image gallery on a site and want to count how many times each
image has been clicked (clicking pulls up the full size image in a
window) so that I know which are popular and which are not.

I though about wimply adding an extra field to the database which serves
up the image details, and incrementing a number by 1 each time a user
clicks it just before the image is served up. What are the chances of
this falling over if two people were to click the same image at the same
time?

Any other ideas much appreciated.



Jul 22 '05 #9
Figured it out. Thanks. I thought I was being dumb :-)

How can I get this to work so that it doesn't need to be run as a new page?

Someone posted about using client-side script, but I'm faily new to ASP and
creating functions etc. is a little confusing to me right now.

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:el**************@tk2msftngp13.phx.gbl...
you'll have to set the ContentType appropriately if you want the file to
"open"

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Keith" <@.> wrote in message
news:Oq**************@TK2MSFTNGP12.phx.gbl...
Thanks

I might be being dumb here, but:

When I place that code in an ASP document, all it does is list the raw
file contents in the browser. How can I modify it so it actually
processes the file based on it's type (ie. for a JPG/GIF drawm the image,
for a PDF launch the plugin etc.).

Thanks
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2*****************@tk2msftngp13.phx.gbl...
stream it to the client. This allows you to put in code to do whatever
http://www.darkfalz.com/1098

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Keith" <@.> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...
Just looking for some ideas here.

What is the best way to count how many times an image has been clicked?

I have an image gallery on a site and want to count how many times each
image has been clicked (clicking pulls up the full size image in a
window) so that I know which are popular and which are not.

I though about wimply adding an extra field to the database which
serves up the image details, and incrementing a number by 1 each time a
user clicks it just before the image is served up. What are the
chances of this falling over if two people were to click the same image
at the same time?

Any other ideas much appreciated.



Jul 22 '05 #10
you cant with this method, it requires the headers to be modified, which
means new page. You could still do this in the same window though..... if
that's what you mean, but yes it will require another trip to the server

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Keith" <@.> wrote in message news:OI**************@tk2msftngp13.phx.gbl...
Figured it out. Thanks. I thought I was being dumb :-)

How can I get this to work so that it doesn't need to be run as a new
page?

Someone posted about using client-side script, but I'm faily new to ASP
and creating functions etc. is a little confusing to me right now.

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:el**************@tk2msftngp13.phx.gbl...
you'll have to set the ContentType appropriately if you want the file to
"open"

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Keith" <@.> wrote in message
news:Oq**************@TK2MSFTNGP12.phx.gbl...
Thanks

I might be being dumb here, but:

When I place that code in an ASP document, all it does is list the raw
file contents in the browser. How can I modify it so it actually
processes the file based on it's type (ie. for a JPG/GIF drawm the
image, for a PDF launch the plugin etc.).

Thanks
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2*****************@tk2msftngp13.phx.gbl...
stream it to the client. This allows you to put in code to do whatever
http://www.darkfalz.com/1098

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Keith" <@.> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...
> Just looking for some ideas here.
>
> What is the best way to count how many times an image has been
> clicked?
>
> I have an image gallery on a site and want to count how many times
> each image has been clicked (clicking pulls up the full size image in
> a window) so that I know which are popular and which are not.
>
> I though about wimply adding an extra field to the database which
> serves up the image details, and incrementing a number by 1 each time
> a user clicks it just before the image is served up. What are the
> chances of this falling over if two people were to click the same
> image at the same time?
>
> Any other ideas much appreciated.
>



Jul 22 '05 #11
Thank you

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:ek**************@TK2MSFTNGP14.phx.gbl...
you cant with this method, it requires the headers to be modified, which
means new page. You could still do this in the same window though..... if
that's what you mean, but yes it will require another trip to the server

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Keith" <@.> wrote in message
news:OI**************@tk2msftngp13.phx.gbl...
Figured it out. Thanks. I thought I was being dumb :-)

How can I get this to work so that it doesn't need to be run as a new
page?

Someone posted about using client-side script, but I'm faily new to ASP
and creating functions etc. is a little confusing to me right now.

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:el**************@tk2msftngp13.phx.gbl...
you'll have to set the ContentType appropriately if you want the file to
"open"

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Keith" <@.> wrote in message
news:Oq**************@TK2MSFTNGP12.phx.gbl...
Thanks

I might be being dumb here, but:

When I place that code in an ASP document, all it does is list the raw
file contents in the browser. How can I modify it so it actually
processes the file based on it's type (ie. for a JPG/GIF drawm the
image, for a PDF launch the plugin etc.).

Thanks
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2*****************@tk2msftngp13.phx.gbl...
> stream it to the client. This allows you to put in code to do whatever
> http://www.darkfalz.com/1098
>
> --
> Curt Christianson
> Site & Scripts: http://www.Darkfalz.com
> Blog: http://blog.Darkfalz.com
>
>
> "Keith" <@.> wrote in message
> news:uO**************@TK2MSFTNGP12.phx.gbl...
>> Just looking for some ideas here.
>>
>> What is the best way to count how many times an image has been
>> clicked?
>>
>> I have an image gallery on a site and want to count how many times
>> each image has been clicked (clicking pulls up the full size image in
>> a window) so that I know which are popular and which are not.
>>
>> I though about wimply adding an extra field to the database which
>> serves up the image details, and incrementing a number by 1 each time
>> a user clicks it just before the image is served up. What are the
>> chances of this falling over if two people were to click the same
>> image at the same time?
>>
>> Any other ideas much appreciated.
>>
>
>



Jul 22 '05 #12
Gazing into my crystal ball I observed "Keith" <@.> writing in
news:OD**************@tk2msftngp13.phx.gbl:
"Steven Burn" <so*******@in-time.invalid> wrote in message
news:O1**************@TK2MSFTNGP11.phx.gbl...
The DB is going to be the best way of doing it IMHO (just mentioned
the site log's as an alternative)


Drifting very slightly. I would like to use this same idea on an
intranet at work I developed.

We have a number of PDF documents launched from HTTP links. They don't
open in a popup, simply open in Adobe.

How could I catch the click and count it to the DB before it launches
the URL?


This is what I do:

<a href="rspdf.asp?id=123">Open 123 PDF</a>

In rspdf.asp I have something like

<%
dim id
id = request.querystring("id")

update = "update table set counter = counter + 1 where id = " & id
connectionstring.Execute update
response.redirect id & ".pdf"
%>

By the way, it's also a great way to count how many times someone has
clicked on an outside link, so you can go to the owner and say "Hey, I gave
you X amount of referrals"

--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Jul 22 '05 #13
correct. If you put the file, directly on the site, and the user points
directly to it, you can't catch the click with code. Only the IIS logs will
have the hit.,

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Steven Burn" <so*******@in-time.invalid> wrote in message
news:uE**************@TK2MSFTNGP12.phx.gbl...
Unfortunately this also assumes the "clicker" doesn't use the link once
then the direct link that is shown to them, from there on (which unless
you've also allowed for that and secured the document, is whats going to
happen in most cases).

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Adrienne" <ar********@sbcglobal.net> wrote in message
news:Xn****************************@207.115.63.158 ...
| Gazing into my crystal ball I observed "Keith" <@.> writing in
| news:OD**************@tk2msftngp13.phx.gbl:
|
| > "Steven Burn" <so*******@in-time.invalid> wrote in message
| > news:O1**************@TK2MSFTNGP11.phx.gbl...
| >> The DB is going to be the best way of doing it IMHO (just mentioned
| >> the site log's as an alternative)
| >
| > Drifting very slightly. I would like to use this same idea on an
| > intranet at work I developed.
| >
| > We have a number of PDF documents launched from HTTP links. They
don't
| > open in a popup, simply open in Adobe.
| >
| > How could I catch the click and count it to the DB before it launches
| > the URL?
| >
| >
|
| This is what I do:
|
| <a href="rspdf.asp?id=123">Open 123 PDF</a>
|
| In rspdf.asp I have something like
|
| <%
| dim id
| id = request.querystring("id")
|
| update = "update table set counter = counter + 1 where id = " & id
| connectionstring.Execute update
| response.redirect id & ".pdf"
| %>
|
| By the way, it's also a great way to count how many times someone has
| clicked on an outside link, so you can go to the owner and say "Hey, I
gave
| you X amount of referrals"
|
| --
| Adrienne Boswell
| http://www.cavalcade-of-coding.info
| Please respond to the group so others can share

Jul 22 '05 #14
ok, let me rephrase, without a custom ISAPI handler you cant.....

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:u9**************@TK2MSFTNGP15.phx.gbl...
correct. If you put the file, directly on the site, and the user points
directly to it, you can't catch the click with code. Only the IIS logs
will have the hit.,

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Steven Burn" <so*******@in-time.invalid> wrote in message
news:uE**************@TK2MSFTNGP12.phx.gbl...
Unfortunately this also assumes the "clicker" doesn't use the link once
then the direct link that is shown to them, from there on (which unless
you've also allowed for that and secured the document, is whats going to
happen in most cases).

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Adrienne" <ar********@sbcglobal.net> wrote in message
news:Xn****************************@207.115.63.158 ...
| Gazing into my crystal ball I observed "Keith" <@.> writing in
| news:OD**************@tk2msftngp13.phx.gbl:
|
| > "Steven Burn" <so*******@in-time.invalid> wrote in message
| > news:O1**************@TK2MSFTNGP11.phx.gbl...
| >> The DB is going to be the best way of doing it IMHO (just mentioned
| >> the site log's as an alternative)
| >
| > Drifting very slightly. I would like to use this same idea on an
| > intranet at work I developed.
| >
| > We have a number of PDF documents launched from HTTP links. They
don't
| > open in a popup, simply open in Adobe.
| >
| > How could I catch the click and count it to the DB before it launches
| > the URL?
| >
| >
|
| This is what I do:
|
| <a href="rspdf.asp?id=123">Open 123 PDF</a>
|
| In rspdf.asp I have something like
|
| <%
| dim id
| id = request.querystring("id")
|
| update = "update table set counter = counter + 1 where id = " & id
| connectionstring.Execute update
| response.redirect id & ".pdf"
| %>
|
| By the way, it's also a great way to count how many times someone has
| clicked on an outside link, so you can go to the owner and say "Hey, I
gave
| you X amount of referrals"
|
| --
| Adrienne Boswell
| http://www.cavalcade-of-coding.info
| Please respond to the group so others can share


Jul 22 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Antoni | last post by:
Hello, I was trying to write a simple shopping example, which allows the user to select two poducts and we kept a counter of each item. In this code, the sessions are created, but the files...
6
by: Elbert Lev | last post by:
Please correct me if I'm wrong. Python (as I understand) uses reference counting to determine when to delete the object. As soon as the object goes out of the scope it is deleted. Python does...
1
by: Tony Johansson | last post by:
Hello Experts! I reading a book called programming with design pattern revealed by Tomasz Muldner and here I read something that I don't understand completely. It says "A garbarage...
18
by: ChadDiesel | last post by:
I appreciate the help on this group. I know I've posted a lot here the last couple of weeks, but I was thrown into a database project at my work with very little Access experience. No other...
13
by: Regnab | last post by:
The problem I'm having is the rsa.RecordCount always returns a '1' when I know there should be about 1600 records returned. I read somewhere that one should use '.MoveLast' before recordcount but...
1
by: j | last post by:
Hi, I've been trying to do line/character counts on documents that are being uploaded. As well as the "counting" I also have to remove certain sections from the file. So, firstly I was working...
11
by: Al | last post by:
Can anyone tell me if there's a way to return the amount of times a button is "clicked" I need to change text in a text box and that text changes each time the button is clicked-up to 6 times...
4
by: aaronfude | last post by:
Hi, Please consider the following class (it's not really my class, but it's a good example for my question): class Vector { int myN; double *myX; Vector(int n) : myN(n), myX(new double) { }...
3
by: vipbus7 | last post by:
Have a counter in place, however, it isn't correctly counting clicks in a listbox...help....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.