Expand all

mw.testKitchen.InstrumentInterface

Methods

isInSample() → {boolean} #

Gets whether the instrument is in-sample.

Returns:

Type
boolean
Source:
Gets whether the instrument is in-sample.

send(action, [interactionData], [contextualAttributes]) #

Sends an analytics event.

If the event sender is an experiment, then the event is decorated with experiment-related data before it is sent. The experiment-related data are specified and documented in the fragment/analytics/product_metrics/experiment schema fragment.

If per-event contextual attributes are passed via the contextualAttributes param, then they are added to the event before it is sent.

Parameters:

Name Type Attributes Description
action string

The action that the user enrolled in this experiment took, e.g. "hover", "click"

interactionData Object optional

Additional data about the action that the user enrolled in the experiment took

contextualAttributes Array.<string> optional

Per-event contextual attributes

Inherited from:
Source:
Sends an analytics event.

setSchema(schemaID) → {mw.testKitchen.InstrumentInterface} #

Sets the ID of the schema used to validate analytics events sent with mw.testKitchen.InstrumentInterface#send.

This method is chainable.

Parameters:

Name Type Description
schemaID string

Returns:

Type
mw.testKitchen.InstrumentInterface
Deprecated:
  • Yes
Source:

Sets the ID of the schema used to validate analytics events sent with mw.testKitchen.InstrumentInterface#send.

submitInteraction(action, [interactionData], [contextualAttributes])package #

Sends an analytics event.

This method makes mw.testKitchen.InstrumentInterface compatible with the click-through rate implementation in the ext.wikimediaEvents.testKitchen ResourceLoader module by proxying to mw.testKitchen.InstrumentInterface#send. Calling this outside of Test Kitchen is not supported.

If per-event contextual attributes are passed via the contextualAttributes param, then they are added to the event before it is sent.

Parameters:

Name Type Attributes Description
action string

The action related to the submitted event

interactionData Object optional

Additional data

contextualAttributes Array.<string> optional

Per-event contextual attributes

Source:
See:
Sends an analytics event.

use(instrumentation) → {mw.testKitchen.InstrumentInterface} #

Uses the generic instrumentation to send analytics events for this instrument.

This method is chainable.

Parameters:

Name Type Description
instrumentation mw.testKitchen.GenericInstrumentation

Returns:

Type
mw.testKitchen.InstrumentInterface
Source:
Uses the generic instrumentation to send analytics events for this instrument.