EasyCFM.COM Contributors
ColdFusion Careers - ColdFusion Jobs
ColdFusion Jobs @ CFC
HTML UI Developer
Posted by: Mitchell Martin
Posted Date: 03/15/2010
Instructional Designer
Posted by: Tekmark Global Solutions, LLC
Posted Date: 03/15/2010
Flash Designer Blue Chip Client Exciting Projects CBD
Posted by: Talent2
Posted Date: 03/15/2010
User Experience Consultant, UX Designer, Usability Engineer
Posted by: Cybercoders.com
Posted Date: 03/15/2010
Flash Designer - UI Designer - Graphic Designer
Posted by: Cybercoders.com
Posted Date: 03/15/2010
Post Career View All
Pablo's ColdFusion Blog
Tracking user clicks.... one way....

A few days ago a user on Easy asked a question about tracking users click through your site, like a breadcrumbs.... now naturally my suggestion was to insert a value to the database and then (based on the user's IP address) return back the data for display. This is still my favorite solution as it is quick and painless; the user however asked me to provide a solution that did not involve the database... so here goes nothing.... (disclaimer, use the database it's better and allows you to get data long term, but for a short timespan type thing this might help you... so I thought I'd post it.


Put this in your application.cfm or application.cfc
(onRequestStart).

<!--- create an application structure to track all
users --->

<cfparam name="application.clickStream"
default="#structNew()#" />

<!--- create an array in the structure for this user
(by ip) --->

<cfparam
name="application.clickStream['user_'&cgi.REMOTE_ADDR]"
default="#arrayNew(1)#" />


<!--- now insert this current page for this user --->
<cfset application.clickStream['user_'&cgi.REMOTE_ADDR][val(ar
rayLen(application.clickStream['user_'&cgi.REMOTE_ADDR]
)+1)] = cgi.SCRIPT_NAME /
>



<!--- THIS you can use to see the actual dump of all
users... --->


<cfdump var="#application.clickStream#" />

As mentioned before, the database is the best route; but this is one route you could go.

Newests ColdFusion Discussions On The EasyCFM Forums
  Topic Title Views Last Updated
CFB 2 3-18-10 @ 11:16 PM
GetPageContext not working 11 3-18-10 @ 7:37 PM
Set up data source in cf admin? 18 3-18-10 @ 11:51 AM
I only with it had been sooner... :) 90 3-17-10 @ 10:19 AM
CFAutosuggest Help 24 3-16-10 @ 12:46 PM
EasyCFM Testimonials
No Comments
Well, no comments about easycfm.com. The site is the best Cold Fusion tutorial site of the world. Congratulations easycfm

Posted by: Marcos Placoná
Posted on: 07/23/2003
EasyCFM Technical Cartoons By Cecilia Elman
Random Technical Cartoons
Powered by WebRing.
Download the EasyCFM.COM Browser Toolbar!
EasyCFM Search Provider Add Search Provider Don't Show Note