Methods
enqueue(callback)static
#
getUserEditCountBucket(editCount) → {string|null
}static
#
null
}static
#
Provide the user's edit count as a low-granularity bucket name.
Parameters:
Name | Type | Description |
---|---|---|
editCount |
number
|
null
|
User edit count, or null for anonymous performers. |
Returns:
null
for anonymous performers.
Do not use this value in conjunction with other edit count bucketing, or you will deanonymize users to some degree.
- Type
-
string
|
null
logEvent(schemaName, eventData) → {jQuery.Promise}static
#
Construct and transmit to a remote server a record of some event having occurred. Events are represented as JavaScript objects that conform to a JSON Schema. The schema describes the properties the event object may (or must) contain and their type. This method represents the public client-side API of EventLogging.
Parameters:
Name | Type | Description |
---|---|---|
schemaName |
string | Canonical schema name. |
eventData |
Object | Event object. |
Returns:
jQuery Promise object for the logging call.
- Type
- jQuery.Promise
Construct and transmit to a remote server a record of some event having occurred.
logFailure(schemaName, errorCode)static
#
pageviewInSample(populationSize) → {boolean}static
#
Determine whether the current event is sampled given a sampling ratio per pageview.
sendBeacon(url)static
#
sessionInSample(populationSize) → {boolean}static
#
Determine whether the current sessionId is sampled given a sampling ratio. This method is deterministic given same sampling rate and sessionId, so sampling is sticky given a session and a sampling rate
Parameters:
Name | Type | Description |
---|---|---|
populationSize |
number | One in how many should be included. 0 means nobody, 1 is 100%, 2 is 50%, etc. |
Returns:
- Type
- boolean