Analytics.common Class
Access point: ac.analytics.* Provides an easy way to stash analytics information within child mojits and retrieve them within parent after the children have been executed. Data handled by this addon, however, cannot be used to augment the normal data flow. IE: you cannot retrieve analytics data and then call ac.done().
Item Index
Methods
Methods
retrieve
-
cb -
[optional]
To retrieve analytics data that has been stored by child mojits, call this function and provide a function, which will be called once the children have been dispatched and all their analytics data has been merged.
Parameters:
-
cbFunctioncallback invoked with the analytics object.
-
[optional]Object optionalscope scope of the callback.
setmergeFunction
-
fn
Allows a way for addons mixed in after this one to set an alternate data merge function when analytics from multiple children are combined. The default merge function is the same one used internally by Mojito to merge meta data, and will be sufficient for most use cases.
Parameters:
-
fnFunctionuser-defined merge function, which should accept two objects, the first is "to", and the second is "from". this function should return the merged object.
store
-
val
Store an analytic value. This function can be called multiple times within a mojit, and uses a merging function to combine objects.
Parameters:
-
valObjectAn object bag full of whatever you wish.
