README 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. -------------------------------------------------------------------------------
  2. dojox.analytics
  3. -------------------------------------------------------------------------------
  4. Version 1.0
  5. Release date: 12/17/2007
  6. -------------------------------------------------------------------------------
  7. Project state:
  8. [base]: alpha
  9. [Urchin]: alpha
  10. -------------------------------------------------------------------------------
  11. Project authors
  12. Dustin Machi (dmachi)
  13. Peter Higgins (dante)
  14. -------------------------------------------------------------------------------
  15. Project description
  16. analytics and client monitoring system. Including the base analytics
  17. system and any number of plugins enables logging of different system data
  18. back to the server. Plugins included at this time:
  19. dojo - reports dojo startup collected information
  20. window - reports available window information to the server
  21. mouseOver - allows periodic sampling of mouseOver
  22. mouseClick - reports any mouse clicks to the server
  23. idle - reports idle/activity
  24. consoleMessages - reports console.* messages to the server
  25. Additionally, a Google Analytics (Urchin tracker) helper is included
  26. in this project, though is unrelated to the Core dojox.analytics
  27. project code.
  28. -------------------------------------------------------------------------------
  29. Dependencies:
  30. Dojo Core (package loader).
  31. -------------------------------------------------------------------------------
  32. Documentation
  33. Usage:
  34. The primary intended usage will be to create a custom build layer that includes
  35. the particular plugins you need for your project. However in practice you
  36. can use the system as such:
  37. <script type="text/javascript" src="../../../dojo/dojo.js"
  38. djConfig="parseOnLoad: true, isDebug: false, usePlainJson: true, sendMethod: 'script', sendInterval: 5000"></script>
  39. <script language="JavaScript" type="text/javascript">
  40. // include the analytics system
  41. dojo.require("dojox.analytics");
  42. //tracks mouse clicks on the page
  43. dojo.require("dojox.analytics.plugins.mouseClick");
  44. // this plugin returns the informatin dojo collects when it launches
  45. dojo.require("dojox.analytics.plugins.dojo");
  46. // this plugin return the information the window has when it launches
  47. // and it also ties to a few events such as window.option
  48. dojo.require("dojox.analytics.plugins.window");
  49. // this plugin tracks console. message, It logs console.error, warn, and
  50. // info messages to the tracker. It also defines console.rlog() which
  51. // can be used to log only to the server. Note that if isDebug() is disabled
  52. // you will still see the console messages on the sever, but not in the actual
  53. // browser console.
  54. dojo.require("dojox.analytics.plugins.consoleMessages");
  55. // tracks where a mouse is on a page an what it is over, periodically sampling
  56. // and storing this data
  57. dojo.require("dojox.analytics.plugins.mouseOver");
  58. //tracks when the user has gone idle
  59. dojo.require("dojox.analytics.plugins.idle");
  60. </script>
  61. When done using a build, none of the dojo.require() statement will be requires
  62. would already be in the build.
  63. Most of the plugins and the base itself have a number of configurable params
  64. that are passed in via the djConfig variable set. This approach is taken so that
  65. the parameters can be easily provided in the case of a build or for a custom
  66. dojo.js build with analytics built in. Examples for different build profiles
  67. are in the profiles directory.
  68. Available Configuration Parameters:
  69. Base Configs
  70. sendInterval - Normal send interval. Default 5000
  71. sendMethod - "script" || "xhrPost"
  72. inTransitRetry - Delay before retrying an a send if it was in transit
  73. or if there is still data to be sent after a post.
  74. Default 1000
  75. analyticsUrl - url to send logging data to. defaults to the test php
  76. file for now
  77. maxRequestSize - Maximum size of GET style requests. Capped at 2000 for
  78. IE, and 4000 otherwise
  79. consoleMessages Config:
  80. consoleLogFuncs - functions from the console object that you will log to
  81. the server. If the console object doesn't exist
  82. or a particuarl method doesn't exist it will be
  83. created as a remote logging only method. This provides
  84. a quick and convient way to automatically define
  85. a remote logging funciton that includes the functions
  86. name in the log. The 'rlog' in the default paramerters
  87. is an example of this. Defaults to ["error", "warn", "info", "rlog"]
  88. idle Config:
  89. idleTime - Number of ms to be idle before being reported to the server as idle
  90. mouseOver config:
  91. targetProps - the properties whose values will be reported for each target from
  92. a mouse over sample. defaults to ["id","className","localName","href", "spellcheck", "lang", "textContent", "value" ]
  93. sampleDelay - the delay in ms between mouseover samples. Defaults to 2500
  94. window config:
  95. windowConnects - methods on the window objec that will be attached to
  96. have its data passed to the server when called.
  97. Note that the basic usage of this system simply serializes json with toJson() when passed
  98. to the analytics addData() method. If data is passed that has circular references
  99. it will die. Take care not to do that or be surprised when it doens't work
  100. in those cases.
  101. -------------------------------------------------------------------------------
  102. Installation instructions
  103. Grab the following from the Dojo SVN Repository:
  104. http://svn.dojotoolkit.org/var/src/dojo/dojox/trunk/analytics
  105. Install into the following directory structure:
  106. /dojox/analytics/
  107. ...which should be at the same level as your Dojo checkout.