amit_dutta
asked on
Hit count on a domino web page
i have launched a web page on domino server of my organization, now i want to know that how many people have hit that page. How can can i get the hit count and show it on my web page. I am using release 4.6.2
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Here is a modification to the same agent that do almost the same, the difference is that in this case the hit counter is independent for each document a user access from the website (using the same form)
Sub Initialize
Dim Session As New NotesSession
Dim doc As NotesDocument
Dim counter As Double
Dim countStr As String
Set db = Session.CurrentDatabase
Set doc = Session.DocumentContext
countStr = doc.FCounter(0)
If countStr = "" Then
counter = 1
Else
counter = Cdbl(countStr) + 1
End If
doc.FCounter = counter
Call doc.save(False,False)
End Sub
Put this code on an agent, which should be on the WebQueryOpen of your form.
FCounter should be on your form and its type is Number and Computed
Good Luck!
Sub Initialize
Dim Session As New NotesSession
Dim doc As NotesDocument
Dim counter As Double
Dim countStr As String
Set db = Session.CurrentDatabase
Set doc = Session.DocumentContext
countStr = doc.FCounter(0)
If countStr = "" Then
counter = 1
Else
counter = Cdbl(countStr) + 1
End If
doc.FCounter = counter
Call doc.save(False,False)
End Sub
Put this code on an agent, which should be on the WebQueryOpen of your form.
FCounter should be on your form and its type is Number and Computed
Good Luck!
FIELD CountDate := CountDate;
FIELD Counter := Counter;
count := @GetProfileField("WebCount
date := @Now;
@If(count='';@Do(@SetField
@SetProfileField("WebCount
@SetField("Counter";count)
@SetField("CountDate";@Get
Put above code into "Value" event of a field named "CountDate" of type "Time: Sow Date".
Have another filed named "Counter" of type "Number".
This code in a value event do the same as the agent from dmpdmpdmp above. It's up to you what you like to use.