I have tons of counters on our pages. We just keep track of the number hits. Like a movie pages was viewed 700 times. I do not make a new record for each hit. I would have a table that will grow like a wild weed.
For example: The movie Hostel... On this movie page, I have this query: <cfquery name="updateCounter" datasource="whatever"> Update Hits Set hits = hits + 1 Where CounterID = '1234D1' </cfquery> I have a table name Hits: Stock MoviePage Hits ----- --------- ---- 1234D1 Hostel 7800 When the query is ran, it will update the hits for Hostel by one. For your examples, I was thinking something like this: Hit_ID Page Type Hits ------ ---- ------ --- 1 A View 456 2 A View 74 3 B Action 476 4 B Action 77 Just increase the number of hits. You wont have a table that will grow. So, for a view of Page A, maybe something like this: <cfquery name="updateCounter" datasource="whatever"> Update Hits Set hits = hits + 1 Where Hits_ID = 1 </cfquery> If you do not need to keep track of IP addresses and dates, I would go this route. If not, then make sure you have your columns as small as possible and maybe purge the info on a regular basis. Hope this helps... Jacob -----Original Message----- From: blists [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 13, 2006 2:50 PM To: CF-Talk Subject: RE: Tracking hits/impressions DB design Considerations Jacob, It could possibly be eliminated if it would reduce server resources. We can consider it. Why? Is there a better way to increment a counter of some sort? BrookD At 02:41 PM 6/13/2006, you wrote: >Is it necessary to keep track of the date and IP address for your program? > >-----Original Message----- >From: blists [mailto:[EMAIL PROTECTED] >Sent: Tuesday, June 13, 2006 11:56 AM >To: CF-Talk >Subject: Tracking hits/impressions DB design Considerations > >Hello, > >I am setting out to build a basic split testing program for pages on my >site. I am wondering what is the best approach to database design. >Basically, I'll have two pages PAGE A and PAGE B that I want to show >equally. And I want to track how many times each page is viewed, and how >many times the form on that page is filled out. So basically I have two >parts: > >Part 1 (Display): >--------------------------------------------------------------------------- - >--------- >- Alternate between showing PAGE A or PAGE B: > >My thoughts on this would be to first have a table with 1 record per split >test campaign. It would have the template paths and the campaign info. Then >I would call display.cfm?campaignID=12 which would get the campaign from >the database and then store it in the Application Scope with a flag next to >the page which is currently being shown. > >The next request would check the application scope for the campaign and if >it exists, get the item that is not flagged, redirect the user, and update >the flag. Does this make sense? How should this be locked? > >Part 2 (Tracking) >--------------------------------------------------------------------------- - >- >- track impressions >- track actions/completions > >When the page loads It will include a call to >track.cfm?campaignID=12&page=PAGEA&type=view to track the impression. If >the form on the page gets submitted, another call to >track.cfm?campaignID=12&page=PAGEA&type=action to track the form submission. > >My concern is regarding the DB design and how fast this would be? If my >table looked like this: > >======================================= >SplitTestTrack_tbl >---------------------------------- >id >pagename >campaignID >type >cDateTime >IP >======================================= > >Would this be two slow? How many rows would it take before this started to >run slowly? Does this design seem okay? > >Thanks for the advice! > >BrookD > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:243411 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

