Reply to topic
Unique Page view
Ennio


Joined: 17 Nov 2006
Posts: 98
Location: Scotch Plains, NJ
Reply with quote
What is the best way to create a unique page view, or does any one know a good cftag?

I want to display how many times a page was accessed.
pmeserve
HostMySite Tech

Joined: 19 Mar 2004
Posts: 178
Reply with quote
Ennio - Your basic two options would be updating a text file with a counter, or updating a database table that tracks hits. You could either insert an individual record for each hit, or(probably a much better idea) simply increment a single record that stores total number of hits. If you wanted to track multiple pages, each page could have its own record and associated hit count
tedjtw


Joined: 08 Feb 2005
Posts: 81
Location: Connecticut
Reply with quote
If you save a page view to a database table you can add the users IP address to a field to track unique users.

Add the following :

<cfset newIP = CGI.REMOTE_ADDR>

Next save the 'newIP' variable with an insert statement. This creates a good audit trail too.

HTH
cfer


Joined: 29 Oct 2006
Posts: 16
Reply with quote
Hi Ennio,

Check out this link if it helps http://tutorial7.easycfm.com

There are also other tutorials on hit counter. Just visit the site and enter "hit counter" in the search box, you will see them all.

cfer
Unique Page view
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic