Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

[mv] Advanced Visitor Logging and Footstep Tracing



******    message to minivend-users from "Cameron B. Prince" <cbp@InternetExpertsLLC.com>     ******

Hi list,

I have developed some new functions that replaced my old ssi visitor loggers
and I wanted to share them with the list and get some feedback on the
design.

I know I have not thought of everything, especially when it comes to
handling heavy loads.

Maybe someone would care to shoot some guns at this and help me make it
better.

I setup two new databases as follows:


Database  vlogs_visitors  vlogs_visitors.txt __SQLDSN__
#ifdef SQLUSER
Database  vlogs_visitors  USER         __SQLUSER__
#endif
#ifdef SQLPASS
Database  vlogs_visitors  PASS         __SQLPASS__
#endif
Database  vlogs_visitors  COLUMN_DEF   "number=CHAR(5) NOT NULL PRIMARY KEY"
Database  vlogs_visitors  COLUMN_DEF   "date=text"
Database  vlogs_visitors  COLUMN_DEF   "time=text"
Database  vlogs_visitors  COLUMN_DEF   "session=text"
Database  vlogs_visitors  COLUMN_DEF   "host=text"
Database  vlogs_visitors  COLUMN_DEF   "referrer=text"
Database  vlogs_visitors  COLUMN_DEF   "browser=text"



atabase  vlogs_accesses  vlogs_accesses.txt __SQLDSN__
#ifdef SQLUSER
Database  vlogs_accesses  USER         __SQLUSER__
#endif
#ifdef SQLPASS
Database  vlogs_accesses  PASS         __SQLPASS__
#endif
Database  vlogs_accesses  COLUMN_DEF   "session=CHAR(8) NOT NULL PRIMARY
KEY"
Database  vlogs_accesses  COLUMN_DEF   "date=text"
Database  vlogs_accesses  COLUMN_DEF   "time=text"
Database  vlogs_accesses  COLUMN_DEF   "page=text"


I then use the following code on each page within the site:

(date-fmt is a UserTag that Bill Randle helped me with in a previous post)

[if !scratch logged]
[set logged]1[/set]
[seti date-fmt][date-fmt][/seti]
[search-region more=1 search="
		ra=yes
		st=db
		fi=vlogs_visitors
		ml=99999
		tf=number
		to=nr
		"]
[search-list]
[/search-list]
[if value mv_search_match_count eq 0]
[seti num]1[/seti]
[else]
[seti num][calc][value mv_search_match_count] + 1[/calc][/seti]
[/else]
[/if]
[/search-region]
[seti new_visitor]
[tag flag write]vlogs_visitors[/tag]
[try]
[import table=vlogs_visitors type=LINE continue=NOTES]
number: [scratch num]
date: [scratch date-fmt]
time: [tag op=time]%H:%M:%S[/tag]
session: [data session id]
host: [data session host]
referrer: [data session referer]
browser: [data session browser]
[/import]
[/try]
[catch] There was an error adding entry to visitor log. [/catch]
[/seti]
[/if]

[seti accesses]
[tag flag write]vlogs_accesses[/tag]
[try]
[import table=vlogs_accesses type=LINE continue=NOTES]
session: [data session id]
date: [scratch date-fmt]
time: [tag op=time]%H:%M:%S[/tag]
page: @@MV_PAGE@@
[/import]
[/try]
[catch] There was an error adding entry to visitor log. [/catch]
[/seti]



So basically each user is added to visitors with the full id information
available using standard Minivend tags. Then, each page he views is added to
accesses. This way you can use basic SQL type searches to view each visitor
and click a link to view a list of each page he visited and how long he
viewed each one.


I was disappointed to find that the [data session host] tag does not provide
the ip address when the domain is not defined in DNS.

Can anyone provide code to obtain the visitors' ip address so I could use
[if !scratch host][ip_address][/if] ???


Thanks and please let me know what you all think about this method of
tracking.



Cameron

-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: