RumImpression
Implements
Index
Constructors
Methods
Constructors
constructor
new RumImpression(
baseDimensions: BaseDimensions,
userData: UserData,
navigationType: RumNavigationType,
leavePageHandler: LeavePageHandler,
piTimeoutHandler: PiTimeoutHandler,
): RumImpressionParameters
baseDimensions: BaseDimensionsuserData: UserDatanavigationType: RumNavigationTypeleavePageHandler: LeavePageHandlerpiTimeoutHandler: PiTimeoutHandler
Returns RumImpression
Methods
append
append(key: string, data: TrackingData, immediately?: boolean): voidParameters
key: stringdata: TrackingDataimmediately: boolean = true
Returns void
calculate Relative
calculateRelative(timer: number): numberCalculates a given timer relative to the navigation start.
Parameters
timer: number
Returns number
get Beacon Index
getBeaconIndex(): numberReturns the current beacon index or 0 if no beacon has been sent yet.
Returns number
get Data By Key
getDataByKey(key: string): TrackingDataget Pi Id
getPiId(): stringReturns the pi id of this impression.
Returns string
get Tracked Data
getTrackedData(): TrackingObjectPublic method to get the current tracked RUM data
Returns TrackingObject
init Custom Dimension Data
initCustomDimensionData(plugins: RumPlugin<TrackingData>[]): voidInitialises the custom dimension data which is used for this site.
Parameters
plugins: RumPlugin<TrackingData>[]
Returns void
init Custom Timer Data
initCustomTimerData(plugins: RumPlugin<TrackingData>[]): voidInitialises the custom timer data which is used for this site.
Parameters
plugins: RumPlugin<TrackingData>[]
Returns void
init Enforced Top Level Attributes
initEnforcedTopLevelAttributes(plugins: RumPlugin<TrackingData>[]): voidInitialises enforced top level attributes by applying the default value if no plugin was found which handles the tracking.
Parameters
plugins: RumPlugin<TrackingData>[]
Returns void
report Event
reportEvent(
eventKey: string,
eventStart: number,
durationKey?: string,
eventEnd?: number,
): voidCalculates the time values compared with the start of the navigation. In case of a time range the start and the duration is calculated in milliseconds.
Parameters
eventKey: stringeventStart: numberOptionaldurationKey: stringOptionaleventEnd: number
Returns void
send Collapsed
sendCollapsed(): voidEnsures that multiple calls to send Method will be collapsed if user is not leaving the site.
Returns void
send Current Tracking
sendCurrentTracking(unloadType?: string): voidSends a beacon with the currently unsent data.
Parameters
OptionalunloadType: string
Returns void
set
set(
key: string,
data: TrackingData,
immediately?: boolean,
mode?: boolean | SendMode,
): booleanSets the given data to the given key for tracking. Calling this method multiple times will override old value. To track multiple values per key use append
Parameters
key: stringdata: TrackingDataimmediately: boolean = truemode: boolean | SendMode = false
Returns boolean
true if value is scheduled to be sent with the next beacons, false otherwise.
set Timing
setTiming(
key: string,
data: TrackingData,
immediately?: boolean,
mode?: boolean | SendMode,
): booleanSets the given data to the given key for tracking relatively to the navigationStart when it is numeric. Otherwise it will be tracked normal. Calling this method multiple times will override old value. To track multiple values (without being calculated relatively) per key use append.
Parameters
key: stringdata: TrackingDataimmediately: boolean = truemode: boolean | SendMode = false
Returns boolean
true if value is scheduled to be sent with the next beacons, false otherwise.
track Custom Event
trackCustomEvent(
action: string,
label: string,
value: number,
immediately?: boolean,
withTimestamp?: boolean,
): voidSend custom event information (action, label and value) using a beacon.
Parameters
action: stringlabel: stringvalue: numberimmediately: boolean = truewithTimestamp: boolean = true
Returns void
track Custom Timer
trackCustomTimer(key: string, data: TrackingData, immediately?: boolean): voidSends custom timer information (key and data) using a beacon.
Parameters
key: stringdata: TrackingDataimmediately: boolean = true
Returns void
update Base Dimension
updateBaseDimension(
dimension: keyof BaseDimensions,
newValue: string | number,
): voidUpdates a value of the base dimensions, which will be sent with every tracking beacon.
Parameters
dimension: keyof BaseDimensionsnewValue: string | number
Appends the given data to the given key for tracking. This method can be called multiple times to add multiple data items to the key.