RE: Basic user stats via Coldfusion
Hi Agha Thanks for the info do you have any sample script that you could share so I can see how best to construct the query to capture user details? -Original Message- From: Agha Mehdi [mailto:aghaime...@gmail.com] Sent: 15 December 2009 21:55 To: cf-talk Subject: Re: Basic user stats via Coldfusion Ian, We track user activity in the db. this is the best approach I can think of. I'd just keep inserting every hit for every page from onRequestEnd method in Application.cfc. In your case, you can do it in Application.cfm. That will give you a lot of flexibility when creating reports. Currently our UserActivity table holds about 50M records. I have another process running every day, which normalizes the URLs and separate out key-value pairs for faster searching on URL variables example: keywords, page ids etc. Thanks Agha On Tue, Dec 15, 2009 at 1:42 PM, Jason Durham jdur...@cti-stl.com wrote: You could capture the CGI variables on onRequestStart and insert them into the DB onSessionEnd. You will lose data on server restarts for active sessions. -Original Message- From: DURETTE, STEVEN J (ATTASIAIT) [mailto:sd1...@att.com] Sent: Tuesday, December 15, 2009 10:54 AM To: cf-talk Subject: RE: Basic user stats via Coldfusion Ian, This sounds like you should be looking at the webserver logs. If you are using IIS, you can have it log the Windows Login info in the IIS logs. I don't know if Apache can or not. Then you can use something like LOG Parser from Microsoft to search the log files just like you would with a database. Steve -Original Message- From: Ian Vaughan [mailto:i.vaug...@neath-porttalbot.gov.uk] Sent: Tuesday, December 15, 2009 11:47 AM To: cf-talk Subject: RE: Basic user stats via Coldfusion Hi Jason All I am trying to do is track what url's on our Intranet a unique user accesses each day. There could be a couple of hundred pages. The problem with most analytics software is that they do not capture the user's windows logon/network ID so we can identify exactly who is viewing what on the Intranet. Analytic software such as Google just captures a users IP address which is dynamic and changes each day so we can't tell what employees are accessing certain areas of the Intranet. It would be great if Coldfusion could help provide a solution for this ot if anybody knows of any analytical software that would capture this information? -Original Message- From: Jason Durham [mailto:jdur...@cti-stl.com] Sent: 07 December 2009 17:32 To: cf-talk Subject: RE: Basic user stats via Coldfusion Am I properly restating this... You want to track what pages each user hits in a day. How many pages are we talking about? Couple dozen? Couple hundred? Couple thousand? -Original Message- From: Ian Vaughan [mailto:i.vaug...@neath-porttalbot.gov.uk] Sent: Monday, December 07, 2009 11:06 AM To: cf-talk Subject: Basic user stats via Coldfusion On our intranet I have a coldfusion script that captures a user's network/loginid cfset user = listLast(cgi.REMOTE_USER,\) This variable is then run against a user table with the following 'where' clause WHERE uPPER(NETWORK_ID) = '#ucASE(user)#' This then captures user info such as Loginid Name Job Title Department IP address etc How would you restrict the query so it only runs once on each page per day for each user, instead of running every time the page is loaded? And where would this query be better placed, as I don't really want to include it in each page manually. Any ideas would be welcome? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329215 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Basic user stats via Coldfusion
Hi Steve I have looked in the IIS logs but for some reason the 'cs-username' field is not being populated? Any ideas why this may be the case? -Original Message- From: DURETTE, STEVEN J (ATTASIAIT) [mailto:sd1...@att.com] Sent: 15 December 2009 16:54 To: cf-talk Subject: RE: Basic user stats via Coldfusion Ian, This sounds like you should be looking at the webserver logs. If you are using IIS, you can have it log the Windows Login info in the IIS logs. I don't know if Apache can or not. Then you can use something like LOG Parser from Microsoft to search the log files just like you would with a database. Steve -Original Message- From: Ian Vaughan [mailto:i.vaug...@neath-porttalbot.gov.uk] Sent: Tuesday, December 15, 2009 11:47 AM To: cf-talk Subject: RE: Basic user stats via Coldfusion Hi Jason All I am trying to do is track what url's on our Intranet a unique user accesses each day. There could be a couple of hundred pages. The problem with most analytics software is that they do not capture the user's windows logon/network ID so we can identify exactly who is viewing what on the Intranet. Analytic software such as Google just captures a users IP address which is dynamic and changes each day so we can't tell what employees are accessing certain areas of the Intranet. It would be great if Coldfusion could help provide a solution for this ot if anybody knows of any analytical software that would capture this information? -Original Message- From: Jason Durham [mailto:jdur...@cti-stl.com] Sent: 07 December 2009 17:32 To: cf-talk Subject: RE: Basic user stats via Coldfusion Am I properly restating this... You want to track what pages each user hits in a day. How many pages are we talking about? Couple dozen? Couple hundred? Couple thousand? -Original Message- From: Ian Vaughan [mailto:i.vaug...@neath-porttalbot.gov.uk] Sent: Monday, December 07, 2009 11:06 AM To: cf-talk Subject: Basic user stats via Coldfusion On our intranet I have a coldfusion script that captures a user's network/loginid cfset user = listLast(cgi.REMOTE_USER,\) This variable is then run against a user table with the following 'where' clause WHERE uPPER(NETWORK_ID) = '#ucASE(user)#' This then captures user info such as Loginid Name Job Title Department IP address etc How would you restrict the query so it only runs once on each page per day for each user, instead of running every time the page is loaded? And where would this query be better placed, as I don't really want to include it in each page manually. Any ideas would be welcome? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329216 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Basic user stats via Coldfusion
Hi Steve I have looked in the IIS logs but for some reason the 'cs-username' field is not being populated? Any ideas why this may be the case? Ian -Original Message- From: DURETTE, STEVEN J (ATTASIAIT) [mailto:sd1...@att.com] Sent: 15 December 2009 16:54 To: cf-talk Subject: RE: Basic user stats via Coldfusion Ian, This sounds like you should be looking at the webserver logs. If you are using IIS, you can have it log the Windows Login info in the IIS logs. I don't know if Apache can or not. Then you can use something like LOG Parser from Microsoft to search the log files just like you would with a database. Steve -Original Message- From: Ian Vaughan [mailto:i.vaug...@neath-porttalbot.gov.uk] Sent: Tuesday, December 15, 2009 11:47 AM To: cf-talk Subject: RE: Basic user stats via Coldfusion Hi Jason All I am trying to do is track what url's on our Intranet a unique user accesses each day. There could be a couple of hundred pages. The problem with most analytics software is that they do not capture the user's windows logon/network ID so we can identify exactly who is viewing what on the Intranet. Analytic software such as Google just captures a users IP address which is dynamic and changes each day so we can't tell what employees are accessing certain areas of the Intranet. It would be great if Coldfusion could help provide a solution for this ot if anybody knows of any analytical software that would capture this information? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329217 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Basic user stats via Coldfusion
Well, if this is for a company intranet, go into iis and turn on the nt authentication box. You can leave anonymous checked, but I did have one time where just checking the box made the data available. That was a long time ago and I don't remember what version of IIS it was. Steve -Original Message- From: Ian Vaughan [mailto:i.vaug...@neath-porttalbot.gov.uk] Sent: Thursday, December 17, 2009 6:01 AM To: cf-talk Subject: RE: Basic user stats via Coldfusion Hi Steve I have looked in the IIS logs but for some reason the 'cs-username' field is not being populated? Any ideas why this may be the case? Ian -Original Message- From: DURETTE, STEVEN J (ATTASIAIT) [mailto:sd1...@att.com] Sent: 15 December 2009 16:54 To: cf-talk Subject: RE: Basic user stats via Coldfusion Ian, This sounds like you should be looking at the webserver logs. If you are using IIS, you can have it log the Windows Login info in the IIS logs. I don't know if Apache can or not. Then you can use something like LOG Parser from Microsoft to search the log files just like you would with a database. Steve -Original Message- From: Ian Vaughan [mailto:i.vaug...@neath-porttalbot.gov.uk] Sent: Tuesday, December 15, 2009 11:47 AM To: cf-talk Subject: RE: Basic user stats via Coldfusion Hi Jason All I am trying to do is track what url's on our Intranet a unique user accesses each day. There could be a couple of hundred pages. The problem with most analytics software is that they do not capture the user's windows logon/network ID so we can identify exactly who is viewing what on the Intranet. Analytic software such as Google just captures a users IP address which is dynamic and changes each day so we can't tell what employees are accessing certain areas of the Intranet. It would be great if Coldfusion could help provide a solution for this ot if anybody knows of any analytical software that would capture this information? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329220 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Basic user stats via Coldfusion
Hi Mike I am using Application.cfm but not for this. All I am after are some basic user stats for the Intranet which show their windows login ID as the IP addresses change daily, does Google Analytics log the windows login id? -Original Message- From: Mike Chabot [mailto:mcha...@gmail.com] Sent: 07 December 2009 17:44 To: cf-talk Subject: Re: Basic user stats via Coldfusion Log minimal data to a database table and process the results when the server is less busy. Possibly skip the processing until the report needs to be generated. All you need to store is the page identifier, the user identifier, and the timestamp. You can screen out duplicate page hits in the report or even delete them in a nightly scheduled process. Databases are optimized for querying sets of data. Meaning if you can bundle up a bunch of individual lookups into one big lookup, the overall processing time should be less. Are you familiar with OnRequestStart and an OnRequestEnd? Are you using Application.cfc or Application.cfm? Good luck, Mike Chabot On Mon, Dec 7, 2009 at 12:05 PM, Ian Vaughan i.vaug...@neath-porttalbot.gov.uk wrote: On our intranet I have a coldfusion script that captures a user's network/loginid cfset user = listLast(cgi.REMOTE_USER,\) This variable is then run against a user table with the following 'where' clause WHERE uPPER(NETWORK_ID) = '#ucASE(user)#' This then captures user info such as Loginid Name Job Title Department IP address etc How would you restrict the query so it only runs once on each page per day for each user, instead of running every time the page is loaded? And where would this query be better placed, as I don't really want to include it in each page manually. Any ideas would be welcome? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329153 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Basic user stats via Coldfusion
Hi Jason All I am trying to do is track what url's on our Intranet a unique user accesses each day. There could be a couple of hundred pages. The problem with most analytics software is that they do not capture the user's windows logon/network ID so we can identify exactly who is viewing what on the Intranet. Analytic software such as Google just captures a users IP address which is dynamic and changes each day so we can't tell what employees are accessing certain areas of the Intranet. It would be great if Coldfusion could help provide a solution for this ot if anybody knows of any analytical software that would capture this information? -Original Message- From: Jason Durham [mailto:jdur...@cti-stl.com] Sent: 07 December 2009 17:32 To: cf-talk Subject: RE: Basic user stats via Coldfusion Am I properly restating this... You want to track what pages each user hits in a day. How many pages are we talking about? Couple dozen? Couple hundred? Couple thousand? -Original Message- From: Ian Vaughan [mailto:i.vaug...@neath-porttalbot.gov.uk] Sent: Monday, December 07, 2009 11:06 AM To: cf-talk Subject: Basic user stats via Coldfusion On our intranet I have a coldfusion script that captures a user's network/loginid cfset user = listLast(cgi.REMOTE_USER,\) This variable is then run against a user table with the following 'where' clause WHERE uPPER(NETWORK_ID) = '#ucASE(user)#' This then captures user info such as Loginid Name Job Title Department IP address etc How would you restrict the query so it only runs once on each page per day for each user, instead of running every time the page is loaded? And where would this query be better placed, as I don't really want to include it in each page manually. Any ideas would be welcome? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329156 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Basic user stats via Coldfusion
Ian, This sounds like you should be looking at the webserver logs. If you are using IIS, you can have it log the Windows Login info in the IIS logs. I don't know if Apache can or not. Then you can use something like LOG Parser from Microsoft to search the log files just like you would with a database. Steve -Original Message- From: Ian Vaughan [mailto:i.vaug...@neath-porttalbot.gov.uk] Sent: Tuesday, December 15, 2009 11:47 AM To: cf-talk Subject: RE: Basic user stats via Coldfusion Hi Jason All I am trying to do is track what url's on our Intranet a unique user accesses each day. There could be a couple of hundred pages. The problem with most analytics software is that they do not capture the user's windows logon/network ID so we can identify exactly who is viewing what on the Intranet. Analytic software such as Google just captures a users IP address which is dynamic and changes each day so we can't tell what employees are accessing certain areas of the Intranet. It would be great if Coldfusion could help provide a solution for this ot if anybody knows of any analytical software that would capture this information? -Original Message- From: Jason Durham [mailto:jdur...@cti-stl.com] Sent: 07 December 2009 17:32 To: cf-talk Subject: RE: Basic user stats via Coldfusion Am I properly restating this... You want to track what pages each user hits in a day. How many pages are we talking about? Couple dozen? Couple hundred? Couple thousand? -Original Message- From: Ian Vaughan [mailto:i.vaug...@neath-porttalbot.gov.uk] Sent: Monday, December 07, 2009 11:06 AM To: cf-talk Subject: Basic user stats via Coldfusion On our intranet I have a coldfusion script that captures a user's network/loginid cfset user = listLast(cgi.REMOTE_USER,\) This variable is then run against a user table with the following 'where' clause WHERE uPPER(NETWORK_ID) = '#ucASE(user)#' This then captures user info such as Loginid Name Job Title Department IP address etc How would you restrict the query so it only runs once on each page per day for each user, instead of running every time the page is loaded? And where would this query be better placed, as I don't really want to include it in each page manually. Any ideas would be welcome? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329157 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Basic user stats via Coldfusion
You could capture the CGI variables on onRequestStart and insert them into the DB onSessionEnd. You will lose data on server restarts for active sessions. -Original Message- From: DURETTE, STEVEN J (ATTASIAIT) [mailto:sd1...@att.com] Sent: Tuesday, December 15, 2009 10:54 AM To: cf-talk Subject: RE: Basic user stats via Coldfusion Ian, This sounds like you should be looking at the webserver logs. If you are using IIS, you can have it log the Windows Login info in the IIS logs. I don't know if Apache can or not. Then you can use something like LOG Parser from Microsoft to search the log files just like you would with a database. Steve -Original Message- From: Ian Vaughan [mailto:i.vaug...@neath-porttalbot.gov.uk] Sent: Tuesday, December 15, 2009 11:47 AM To: cf-talk Subject: RE: Basic user stats via Coldfusion Hi Jason All I am trying to do is track what url's on our Intranet a unique user accesses each day. There could be a couple of hundred pages. The problem with most analytics software is that they do not capture the user's windows logon/network ID so we can identify exactly who is viewing what on the Intranet. Analytic software such as Google just captures a users IP address which is dynamic and changes each day so we can't tell what employees are accessing certain areas of the Intranet. It would be great if Coldfusion could help provide a solution for this ot if anybody knows of any analytical software that would capture this information? -Original Message- From: Jason Durham [mailto:jdur...@cti-stl.com] Sent: 07 December 2009 17:32 To: cf-talk Subject: RE: Basic user stats via Coldfusion Am I properly restating this... You want to track what pages each user hits in a day. How many pages are we talking about? Couple dozen? Couple hundred? Couple thousand? -Original Message- From: Ian Vaughan [mailto:i.vaug...@neath-porttalbot.gov.uk] Sent: Monday, December 07, 2009 11:06 AM To: cf-talk Subject: Basic user stats via Coldfusion On our intranet I have a coldfusion script that captures a user's network/loginid cfset user = listLast(cgi.REMOTE_USER,\) This variable is then run against a user table with the following 'where' clause WHERE uPPER(NETWORK_ID) = '#ucASE(user)#' This then captures user info such as Loginid Name Job Title Department IP address etc How would you restrict the query so it only runs once on each page per day for each user, instead of running every time the page is loaded? And where would this query be better placed, as I don't really want to include it in each page manually. Any ideas would be welcome? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329171 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Basic user stats via Coldfusion
Ian, We track user activity in the db. this is the best approach I can think of. I'd just keep inserting every hit for every page from onRequestEnd method in Application.cfc. In your case, you can do it in Application.cfm. That will give you a lot of flexibility when creating reports. Currently our UserActivity table holds about 50M records. I have another process running every day, which normalizes the URLs and separate out key-value pairs for faster searching on URL variables example: keywords, page ids etc. Thanks Agha On Tue, Dec 15, 2009 at 1:42 PM, Jason Durham jdur...@cti-stl.com wrote: You could capture the CGI variables on onRequestStart and insert them into the DB onSessionEnd. You will lose data on server restarts for active sessions. -Original Message- From: DURETTE, STEVEN J (ATTASIAIT) [mailto:sd1...@att.com] Sent: Tuesday, December 15, 2009 10:54 AM To: cf-talk Subject: RE: Basic user stats via Coldfusion Ian, This sounds like you should be looking at the webserver logs. If you are using IIS, you can have it log the Windows Login info in the IIS logs. I don't know if Apache can or not. Then you can use something like LOG Parser from Microsoft to search the log files just like you would with a database. Steve -Original Message- From: Ian Vaughan [mailto:i.vaug...@neath-porttalbot.gov.uk] Sent: Tuesday, December 15, 2009 11:47 AM To: cf-talk Subject: RE: Basic user stats via Coldfusion Hi Jason All I am trying to do is track what url's on our Intranet a unique user accesses each day. There could be a couple of hundred pages. The problem with most analytics software is that they do not capture the user's windows logon/network ID so we can identify exactly who is viewing what on the Intranet. Analytic software such as Google just captures a users IP address which is dynamic and changes each day so we can't tell what employees are accessing certain areas of the Intranet. It would be great if Coldfusion could help provide a solution for this ot if anybody knows of any analytical software that would capture this information? -Original Message- From: Jason Durham [mailto:jdur...@cti-stl.com] Sent: 07 December 2009 17:32 To: cf-talk Subject: RE: Basic user stats via Coldfusion Am I properly restating this... You want to track what pages each user hits in a day. How many pages are we talking about? Couple dozen? Couple hundred? Couple thousand? -Original Message- From: Ian Vaughan [mailto:i.vaug...@neath-porttalbot.gov.uk] Sent: Monday, December 07, 2009 11:06 AM To: cf-talk Subject: Basic user stats via Coldfusion On our intranet I have a coldfusion script that captures a user's network/loginid cfset user = listLast(cgi.REMOTE_USER,\) This variable is then run against a user table with the following 'where' clause WHERE uPPER(NETWORK_ID) = '#ucASE(user)#' This then captures user info such as Loginid Name Job Title Department IP address etc How would you restrict the query so it only runs once on each page per day for each user, instead of running every time the page is loaded? And where would this query be better placed, as I don't really want to include it in each page manually. Any ideas would be welcome? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329172 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Basic user stats via Coldfusion
On our intranet I have a coldfusion script that captures a user's network/loginid cfset user = listLast(cgi.REMOTE_USER,\) This variable is then run against a user table with the following 'where' clause WHERE uPPER(NETWORK_ID) = '#ucASE(user)#' This then captures user info such as Loginid Name Job Title Department IP address etc How would you restrict the query so it only runs once on each page per day for each user, instead of running every time the page is loaded? And where would this query be better placed, as I don't really want to include it in each page manually. Any ideas would be welcome? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328913 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Basic user stats via Coldfusion
How would you restrict the query so it only runs once on each page per day for each user, instead of running every time the page is loaded? Set a cookie that expires after 24 hours. If the cookie doesn't exist, run the query. And where would this query be better placed, as I don't really want to include it in each page manually. In Application.cfm or Application.cfc HTH G! On Mon, Dec 7, 2009 at 12:05 PM, Ian Vaughan i.vaug...@neath-porttalbot.gov.uk wrote: On our intranet I have a coldfusion script that captures a user's network/loginid cfset user = listLast(cgi.REMOTE_USER,\) This variable is then run against a user table with the following 'where' clause WHERE uPPER(NETWORK_ID) = '#ucASE(user)#' This then captures user info such as Loginid Name Job Title Department IP address etc How would you restrict the query so it only runs once on each page per day for each user, instead of running every time the page is loaded? And where would this query be better placed, as I don't really want to include it in each page manually. Any ideas would be welcome? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328915 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Basic user stats via Coldfusion
Am I properly restating this... You want to track what pages each user hits in a day. How many pages are we talking about? Couple dozen? Couple hundred? Couple thousand? -Original Message- From: Ian Vaughan [mailto:i.vaug...@neath-porttalbot.gov.uk] Sent: Monday, December 07, 2009 11:06 AM To: cf-talk Subject: Basic user stats via Coldfusion On our intranet I have a coldfusion script that captures a user's network/loginid cfset user = listLast(cgi.REMOTE_USER,\) This variable is then run against a user table with the following 'where' clause WHERE uPPER(NETWORK_ID) = '#ucASE(user)#' This then captures user info such as Loginid Name Job Title Department IP address etc How would you restrict the query so it only runs once on each page per day for each user, instead of running every time the page is loaded? And where would this query be better placed, as I don't really want to include it in each page manually. Any ideas would be welcome? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328916 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Basic user stats via Coldfusion
Log minimal data to a database table and process the results when the server is less busy. Possibly skip the processing until the report needs to be generated. All you need to store is the page identifier, the user identifier, and the timestamp. You can screen out duplicate page hits in the report or even delete them in a nightly scheduled process. Databases are optimized for querying sets of data. Meaning if you can bundle up a bunch of individual lookups into one big lookup, the overall processing time should be less. Are you familiar with OnRequestStart and an OnRequestEnd? Are you using Application.cfc or Application.cfm? Good luck, Mike Chabot On Mon, Dec 7, 2009 at 12:05 PM, Ian Vaughan i.vaug...@neath-porttalbot.gov.uk wrote: On our intranet I have a coldfusion script that captures a user's network/loginid cfset user = listLast(cgi.REMOTE_USER,\) This variable is then run against a user table with the following 'where' clause WHERE uPPER(NETWORK_ID) = '#ucASE(user)#' This then captures user info such as Loginid Name Job Title Department IP address etc How would you restrict the query so it only runs once on each page per day for each user, instead of running every time the page is loaded? And where would this query be better placed, as I don't really want to include it in each page manually. Any ideas would be welcome? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328920 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
re: Basic user stats via Coldfusion
Include it in the onSessionStart method of Application.cfc and it will run only once per login. If you really only want it once per day (if, for example, users sometimes logout/in several times per day), then you could add a date test to the log INSERT query: cfquery ... IF NOT EXISTS ( SELECT loginID FROM loginLog WHERE loginID = '#uCase(user)#' AND loginTime = cfqueryparam cfsqltype=CF_SQL_DATE value=#now()# / ) BEGIN INSERT INTO loginLog ( loginID, name, jobTitle, department ... [and so on] END /cfquery ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328921 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Basic user stats via Coldfusion
How would you restrict the query so it only runs once on each page per day for each user, instead of running every time the page is loaded? Set a cookie that expires after 24 hours. If the cookie doesn't exist, run the query. That probably wouldn't be a good idea, as you'd be setting a lot of cookies - presumably one per page. Eventually, you'd reach the limit of the number of cookies per domain, which is pretty low as I recall. A better approach would be to track the pages visited in the Session scope. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328925 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4