task

FEATURE - user analytics

[WHAT]

  1. ] new admin feature to report which CD pages our users are viewing
    1.  ENHANCEMENT to the web server log data which does not provide qstring or pages by user, so while we do know that PG 'view/articles' OR PG view/article was viewed (x) times in a given period but we do not know which articles(in qstring) nor do we know which which user viewed it, what we want to know is which user viewed which pages,

[WHY]

  1. ] associate each unique visitor (by ip) with user session(s)
    1. ] referrer =  where did visitor arrive from
  2. ] pages 
    1. ] which page or pages did user (x) visit on our site 
  3. ] properties
    1. ] user.register ed
    2. ] user guest
    3. ?] session id
    4. ] page count = #
    5. ] page path = string [], ex ["index", "view/libraries", "view/Books?id=#", ...]
    6. ] page.ref = url
    7. ] session start time  
    8. ] session exit time
  4. ]

[WHERE]

  1. ] access from 'site admin' page 

[WHEN]

  1. ] August 2013

[EXAMPLE]

  1. ] Report By Period(day, week, month, qtr, year)
    1. each user (ip or name)
      1. VISIT date, pages(count), time st, ttl, pages[]

[HOW-TO]

  1. ] db owner
    1. ] id
    2. ] dbName
    3. ] sName
    4. ] ownerUserId
  2. ] sospeps
    1. ] id
    2. ] uId
    3. ] dbId
    4. ] role
  3. ] user-profile
    1. ] em
    2. ] id
    3. ] sName
    4. ] sDesc
  4. ] membership
    1. ]
  5. ] roles
    1. ]
  6. ] membersInRole
    1. ]
  7. ] IeNumerable<sospep>sospeps{
    1. return getSospeps }

[REFERENCE]

  1. ] PageStart -v-001 - ] working 
  2. ] PageStart -v-002 - ] CUT greenspace ] REM   is authenticated block to set 'current'
  3. ] siteLayout - just used TESTING, for writing valuees to page
  4. ] ana - report analytics records
  5. ] ana1 -  report analytics records
  6. ] User.cs - 
  7. ] PageStart -v-00#
 

developer implementation

[process]

  1.  ] PG pageStart
    1. i] if (cookie) - read cookie values for .... 
      1. ] count
      2. ] page = page url + qstring
      3. ] ip 
      4. ] referred
    2. i] else no cookie
      1. ] initialize Page variables for each property
    3. ] adjust for this. page
      1. x] increase page count
      2. x] ADD current page to pages list 
    4. x] PG PageStart save cookie 
      1. *] as user traverses site, cookie is read, adjusted on each page (count++, ), saved, then loaded on next page 
  2. i] Global asax - on session timeout
    1. ] save cookie info to db PRB cant read Request.Cookies at this point
    2. *] info = pages, pgCount, ip, referrer, +datetimeSessionStart, SessionEnd, duration  
  3. ] PAGES - x] /view/, x] /add/, x] /edit/, x] delete 
    1. x] libraries, books, chapters, articles, article REMOVE - SET sesion var =, use Page.user which is set in the PageStart 
    2. x] warehouses, ...
    3. x] ...
  4. ] READ - data
    1. ] how many sessions, period(day), list by ip
    2. ] each session

[notes]

  1. STRATEGY-1 
    1. ] write each page visit to cookie
    2. ] on pageStart read cookie, add page info, update cookie
    3. ] on session end(using global.asax), write cookie to db record
      1. PRB on session end event, cookie is gone
  2. STRATEGY-2
    1. ] on each page, get page visit info 
    2. ] post pageVisit info to NEW user properties, 
    3. ] post pageVisit info to NEW db table  
  3. GLOBAL.ASAX
    1. write 'event handler' code the can hook into 'application lifecycle' events like 'init', session_Start, Session_End
    2. using Import namespace statement to ....
  4. HTTP MODULES - for every request
    1. WHAT = assembly that is CALLED on EVERY REQUEST to your app, 
    2. WHY = for logging, security, 
    3. ] examine incoming requests, an HTTP module can perform custom authentication or other security checks before the requested page, 
    4. ] Can subscribe to application lifecycle events (init, app start, app end, session start , session end)
  5. HTTP HANDLERS for every request with file extension(.xyz) 
    1. WHAT = ( process (endpoint) that executes in response to a request for a particular file type), default for web application is .aspx, also have asmx for ___ and 
    2. WHY USE = .rss feed, image server - serve different size images for PGs based upon{screen size}, 
  6. // ERROR Task is a type, not a namespace 
  7. Import Task // ERROR task is a Type that is used like a namespace
  8. % @Import Namespace="global"%  //does not exist
  9. Import sospepApp.Task // ERROR Task does not exist from files using task
    1. - likely need to add a @using sospepApp.Task to each page with a Task object
  10. WORKS % @Import Namespace="WebMatrix.Data"%  
  11. ] ive got a web pages app and am trying to add a lightweight user tracking module.
  12. for each session i want to track the pages the user visits i would prefer not to hit the db on each page and just store the users trail in a cookie and then when the session ends, get the info from the tracking cookie and post it into the db. the PROBLEM i have is ...
  13. > have a webpages app and i am trying to hook into the hook into the global.asax Session_End event 
  14. > The Session_End event is firing but "my code" is not executing. 
  15.   public const string  qryTaskAdd="INSERT INTO tasks (name_task, description_task, parent_id, start_time, duration, photo, content_task, content_format,status,priority, owner) " + "VALUES 
  16. (@0,@1,@2,@3,@4,@5,@6,@7,@8,@9,@10)"; 

 


 

status

 

[previously]

  1. x] [2013-08-11]
    1. x] PageStart - v-001 - original version with ....
    2. x] PageStart - v-002 ] cleanup ] add code to get from user ( ] "ip", ]  referred, ] ... )
    3. x] DOC - feature - user analytics 
    4. x] PG SiteLayout - used for TESTing, output variables 
    5. i] PGs - veiw/{L1} libraries - remove SET user code, replaced with Page.user
  2. x] [2013-08-13] - PAGEs/
    1. x] PG view/{L1} - remove SET Session user from page, replaced with Page User, remove file extension from links, 
    2. x] PG view/{L2} - remove SET Session user from page, replaced with Page User, remove file extension from links, 
    3. x] PG view/{L2} - remove SET Session user from page, replaced with Page User, remove file extension from links,
    4. x] PG view/{L3} - remove SET Session user from page, replaced with Page User, remove file extension from links, 
    5. x] PG view/{L4} - remove SET Session user from page, replaced with Page User(2*), remove file extension from link,
    6. x] PG view/{L5} - remove SET Session user from page, replaced with Page User(2**), remove file extension from link,
    7. x] PG add/{subjects, objects,...} 
      1. ] remove SET session user, use page for permission
    8. x] edit/{subjects, objects, ...}
      1. ]  
    9. x] TEST get sessionTimeout value
      1. x] this works, but only returns the value specified in the SessionTimeout property, NOT the time remaining in the session
  3. i] [2013-08-15] PG global_asax
    1. x] read cookie
    2. x] insert db record
    3. x] import namespace (WebMatrix.Data to use db)
    4. ] PRB using sospep Task class b/c of no namespace ? IF create namespace then have to add a @using namespace to each page with Task object
    5. i] WA insert db qry
    6. *] TEST application lock - all code needs to be inside here?
    7. ] PRB cant read cookie values in the Session_End event ( b/c Request ojbject is eol ) 
    8. ] OVU page overide VS scripts 
    9. i] PG ana
      1. ] display records that are inserted into E.templates/all/prj-022 (parent id = 157) BY session end
      2. *] PRB with partial records
  4. [2013-08-21]
    1. ] PG pageStart -v-002-cookies, replaced with PageStart-v-00# ( using REVISED User object to track visits)
    2. ] PG pageStart -v-00#
    3. ] CS User 
      1. added properties for ] ip, ] page
      2. added method logVisit() which posts user + page info to db
    4. ] DB 'public'
      1. added table 'visits', 

[current]

  1.  [2014-04-29] DASHBOARD
    1. QTR-00 --  0 - customers, 0 - revenue, 0 - growth
      1. customers -
      2. revenue - ] qtr, prj-Ann ] 
      3. growth - ] customers ] users ttl, active ] traffic
    2. QTR-01 --  12 - customers, 1.2k - revenue, 100% - growth
      1. sample data
    3. QTR-02 --  36 - customers, 3.6k - revenue, 200% - growth
    4. + expenses

[next]

 

  1. ] fire 'cleanup event' when sessionTimeout fires
Details Photos Edit more

Details

ID: 2282

NAME: FEATURE-User-Analytics

DESCRIPTION: OVERVIEW - create an enhanced log of per user / session activity on site to determine which pages users are visiting, the page path and ...

START DATE TIME: 2013-08-12 21:19:17

EST DURATION: 01:00:00

END DATE TIME: 2013-08-12 22:19:17

STATUS: To-Do

PRIORITY: -5

OWNER ID: 75

Content Photos Edit more

photos

photos for this task

actions

Agenda Email task SMS task Priorities