Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > tracking independant hits to page

Reply
Thread Tools

tracking independant hits to page

 
 
tshad
Guest
Posts: n/a
 
      07-19-2006
I have a page that I need to tell how many INDEPENDANT hits have occurred.

I have the following code:

Sub Page_Load(sender as Object, e as EventArgs)
if not IsPostBack then
Call InsertAuditRecord()
end if
End Sub

Which just writes out to a table on who hit this page for a particular
record.

This works fine, but if you do a refresh, it gets counted as another hit
since it isn't a postback. Also, the user can go to another page and then
come back to this page and it is another hit.

Is there a clean way to handle this so that only one hit to the page/record
is recorded once for each visitor?

This is for users that haven't logged on yet, so I don't have any logon
credentials yet.

I was thinking of putting a cookie on their machine to track it, but don't
know if that is the best way.

Thanks,

Tom.


 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      07-19-2006
Yes, I would think that cookies would be a good informal way of doing this.
It's not 100% bullet proof since people could delete their cookies, but you
may not need it to be 100% bullet proof.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"tshad" <(E-Mail Removed)> wrote in message
news:O%(E-Mail Removed)...
>I have a page that I need to tell how many INDEPENDANT hits have occurred.
>
> I have the following code:
>
> Sub Page_Load(sender as Object, e as EventArgs)
> if not IsPostBack then
> Call InsertAuditRecord()
> end if
> End Sub
>
> Which just writes out to a table on who hit this page for a particular
> record.
>
> This works fine, but if you do a refresh, it gets counted as another hit
> since it isn't a postback. Also, the user can go to another page and then
> come back to this page and it is another hit.
>
> Is there a clean way to handle this so that only one hit to the
> page/record is recorded once for each visitor?
>
> This is for users that haven't logged on yet, so I don't have any logon
> credentials yet.
>
> I was thinking of putting a cookie on their machine to track it, but don't
> know if that is the best way.
>
> Thanks,
>
> Tom.
>
>



 
Reply With Quote
 
 
 
 
tshad
Guest
Posts: n/a
 
      07-20-2006
"Steve C. Orr [MVP, MCSD]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Yes, I would think that cookies would be a good informal way of doing
> this.
> It's not 100% bullet proof since people could delete their cookies, but
> you may not need it to be 100% bullet proof.


That was what I figured. Probably the best I can do.

Thanks,

Tom
>
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
>
> "tshad" <(E-Mail Removed)> wrote in message
> news:O%(E-Mail Removed)...
>>I have a page that I need to tell how many INDEPENDANT hits have occurred.
>>
>> I have the following code:
>>
>> Sub Page_Load(sender as Object, e as EventArgs)
>> if not IsPostBack then
>> Call InsertAuditRecord()
>> end if
>> End Sub
>>
>> Which just writes out to a table on who hit this page for a particular
>> record.
>>
>> This works fine, but if you do a refresh, it gets counted as another hit
>> since it isn't a postback. Also, the user can go to another page and
>> then come back to this page and it is another hit.
>>
>> Is there a clean way to handle this so that only one hit to the
>> page/record is recorded once for each visitor?
>>
>> This is for users that haven't logged on yet, so I don't have any logon
>> credentials yet.
>>
>> I was thinking of putting a cookie on their machine to track it, but
>> don't know if that is the best way.
>>
>> Thanks,
>>
>> Tom.
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tracking Someone Tracking Me Edw. Peach Computer Security 4 07-07-2005 05:50 PM
Tracking hits...bots vs. real users Amil ASP .Net 2 01-14-2005 07:49 PM
document.referrer question for tracking hits and visits goks Javascript 7 05-30-2004 01:16 AM
Number of hits divided by "robot hits" Dos-Man HTML 5 03-04-2004 07:56 AM
Prevent 'Page has expired' when a client hits back to return to a search page Mike ASP .Net 1 08-08-2003 03:05 PM



Advertisments