Unique Hits!
Thank You,
Fusionite...
Main Topics
Browse All TopicsHello,
I am interested in creating a coldfusion hit counter for my website. I need the hit counter code to work and yet monitor several pages
page1.cfm
page2.cfm
page3.cfm
I need the hits from these pages in a weekly or monthly format so I can pass them along to management. I'd like the ability to breakdown the analysis to by the day for accuracy.
I appreciate your help!
Fusionite...
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
unique hits - kind of
<cfset pageId="someUniquePageName
<cfif not isDefined("session.counter
<cfset SESSION.Auth = StructNew()>
<cfelse>
<cfif not isDefined("session.counter
<cfset session.counter.#pageId# = true>
<cfquery name="incrementCounter">
insert into pageHits values(<cfqueryparam value="#pageId#">,<cfquery
</cfquery>
</cfif>
</cfif>
or if you just want hits
<cfquery name="incrementCounter">
insert into pageHits values(<cfqueryparam value="#pageId#">,<cfquery
</cfquery>
instead of sessions you could also use cookies which could expire in 24 hrs
to get the hits
select count(*)
from PAGEHITS
GROUPBY PAGEID, #dateFormat(HITDATE,"mm,dd
take a look at this link, may be it is helpful
http://tutorial7.easycfm.c
What Jester is suggesting can actually easily be archieved with #client.hitCount# i.e. ColdFusion already has a function to do this, you need to enable Client Management though in the cfapplication tag.
However, this is not a unique visitor or unique page count - so I guess it's not what you are after.
If it is statistics that you are after, you might be better of buying a statistics package that imports and analyzes the webserver logs, it's much faster, more reliable and gives more overview of the statistics. Just search in google for log analyzer, livestats.com is a good one.
Then there are also free services provided by websites, they make you include a little 1px image on your site and they will provide you with the stats, redsherif.com is one of them
Business Accounts
Answer for Membership
by: Jester_48Posted on 2003-12-15 at 12:04:17ID: 9944347
did you want hits or unique hits?