README 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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. Ed Chatelain (edchat) added touch and gesture support 11/15/2011.
  15. -------------------------------------------------------------------------------
  16. Project description
  17. analytics and client monitoring system. Including the base analytics
  18. system and any number of plugins enables logging of different system data
  19. back to the server. Plugins included at this time:
  20. dojo - reports dojo startup collected information
  21. window - reports available window information to the server
  22. mouseOver - allows periodic sampling of mouseOver
  23. mouseClick - reports any mouse clicks to the server
  24. idle - reports idle/activity
  25. consoleMessages - reports console.* messages to the server
  26. touchPress - reports touch.press and touch.release
  27. touchMove - allows periodic sampling during a touch.move
  28. gestureEvents - reports swipe, tap, tap.doubletap, tap.taphold
  29. Additionally, a Google Analytics (Urchin tracker) helper is included
  30. in this project, though is unrelated to the Core dojox.analytics
  31. project code.
  32. -------------------------------------------------------------------------------
  33. Dependencies:
  34. Dojo Core (package loader).
  35. -------------------------------------------------------------------------------
  36. Documentation
  37. Usage:
  38. The primary intended usage will be to create a custom build layer that includes
  39. the particular plugins you need for your project. However in practice you
  40. can use the system as such:
  41. <script type="text/javascript" src="../../../dojo/dojo.js"
  42. djConfig="parseOnLoad: true, isDebug: false, usePlainJson: true, sendMethod: 'script', sendInterval: 5000"></script>
  43. <script language="JavaScript" type="text/javascript">
  44. // include the analytics system
  45. dojo.require("dojox.analytics");
  46. //tracks mouse clicks on the page
  47. dojo.require("dojox.analytics.plugins.mouseClick");
  48. // this plugin returns the information dojo collects when it launches
  49. dojo.require("dojox.analytics.plugins.dojo");
  50. // this plugin return the information the window has when it launches
  51. // and it also ties to a few events such as window.option
  52. dojo.require("dojox.analytics.plugins.window");
  53. // this plugin tracks console. message, It logs console.error, warn, and
  54. // info messages to the tracker. It also defines console.rlog() which
  55. // can be used to log only to the server. Note that if isDebug() is disabled
  56. // you will still see the console messages on the sever, but not in the actual
  57. // browser console.
  58. dojo.require("dojox.analytics.plugins.consoleMessages");
  59. // tracks where a mouse is on a page an what it is over, periodically sampling
  60. // and storing this data
  61. dojo.require("dojox.analytics.plugins.mouseOver");
  62. //tracks touch press and touch release on the page
  63. dojo.require("dojox.analytics.plugins.touchPress");
  64. // tracks where a touch move is done on a page, what it is over, periodically sampling
  65. // and storing this data
  66. dojo.require("dojox.analytics.plugins.touchMove");
  67. // tracks these gesture events tap, taphold, doubletap, and swipe using the dojox.gesture
  68. // support. For swipe it will periodically sample and store the data
  69. dojo.require("dojox.analytics.plugins.gestureEvents");
  70. //tracks when the user has gone idle
  71. dojo.require("dojox.analytics.plugins.idle");
  72. </script>
  73. When done using a build, none of the dojo.require() statement will be requires
  74. would already be in the build.
  75. Most of the plugins and the base itself have a number of configurable params
  76. that are passed in via the djConfig variable set. This approach is taken so that
  77. the parameters can be easily provided in the case of a build or for a custom
  78. dojo.js build with analytics built in. Examples for different build profiles
  79. are in the profiles directory.
  80. Available Configuration Parameters:
  81. Base Configs
  82. sendInterval - Normal send interval. Default 5000
  83. sendMethod - "script" || "xhrPost"
  84. inTransitRetry - Delay before retrying an a send if it was in transit
  85. or if there is still data to be sent after a post.
  86. Default 1000
  87. analyticsUrl - url to send logging data to. defaults to the test php
  88. file for now
  89. maxRequestSize - Maximum size of GET style requests. Capped at 2000 for
  90. IE, and 4000 otherwise
  91. consoleMessages Config:
  92. consoleLogFuncs - functions from the console object that you will log to
  93. the server. If the console object doesn't exist
  94. or a particular method doesn't exist it will be
  95. created as a remote logging only method. This provides
  96. a quick and convenient way to automatically define
  97. a remote logging function that includes the functions
  98. name in the log. The 'rlog' in the default parameters
  99. is an example of this. Defaults to ["error", "warn", "info", "rlog"]
  100. idle Config:
  101. idleTime - Number of ms to be idle before being reported to the server as idle
  102. mouseClick config:
  103. targetProps - the properties whose values will be reported for each target from
  104. a mouse click sample.
  105. defaults to ["id","className","nodeName", "localName","href", "spellcheck", "lang"]
  106. textContentMaxChars - the max number of characters to show for text or textContent, defaults to 50
  107. mouseOver config:
  108. targetProps - the properties whose values will be reported for each target from
  109. a mouse over sample.
  110. defaults to ["id","className","localName","href", "spellcheck", "lang", "textContent", "value" ]
  111. watchMouseOver - log mouseover and mouseout events defaults to true
  112. sampleDelay - the delay in ms between mouseover samples. Defaults to 2500
  113. textContentMaxChars - the max number of characters to show for text or textContent, defaults to 50
  114. window config:
  115. windowConnects - methods on the window objec that will be attached to
  116. have its data passed to the server when called.
  117. touchPress config:
  118. targetProps - the properties whose values will be reported for each target from
  119. a touch.press or touch.release sample.
  120. defaults to ["id","className","nodeName", "localName","href", "spellcheck", "lang"]
  121. textContentMaxChars - the max number of characters to show for text or textContent, defaults to 50
  122. showTouchesDetails - include the details for the touches in the touches array, defaults to true
  123. touchMove config:
  124. targetProps - the properties whose values will be reported for each target from
  125. a touch move sample.
  126. defaults to ["id","className","localName","href", "spellcheck", "lang", "textContent", "value" ]
  127. textContentMaxChars - the max number of characters to show for text or textContent, defaults to 50
  128. showTouchesDetails - include the details for the touches in the touches array, defaults to true
  129. touchSampleDelay - the delay in ms between touch.move samples. Defaults to 1000
  130. gestureEvents config:
  131. targetProps - the properties whose values will be reported for each target from
  132. a gesture event (tap, taphold, doubletap, swipe) sample.
  133. defaults to ["id","className","localName","href", "spellcheck", "lang", "textContent", "value" ]
  134. swipeSampleDelay - the delay in ms between swipe samples. Defaults to 1000
  135. textContentMaxChars - the max number of characters to show for text or textContent, defaults to 50
  136. watchSwipe - log swipe events in addition to the tap events, defaults to true
  137. Note that the basic usage of this system simply serializes json with toJson() when passed
  138. to the analytics addData() method. If data is passed that has circular references
  139. it will die. Take care not to do that or be surprised when it doens't work
  140. in those cases.
  141. -------------------------------------------------------------------------------
  142. Installation instructions
  143. Grab the following from the Dojo SVN Repository:
  144. http://svn.dojotoolkit.org/var/src/dojo/dojox/trunk/analytics
  145. Install into the following directory structure:
  146. /dojox/analytics/
  147. ...which should be at the same level as your Dojo checkout.