AnalyticService class

Log tracking events

Signature:

export declare class AnalyticService extends ExternalObject 

Extends: ExternalObject

Remarks

Use Runtime.getAnalyticService() to get an instance of this class.

Methods

MethodModifiersDescription
logCustomEvent(key, value)Log a custom event to track something specific to this module
replay()Log when a user completes the experience but choices to redo it
setPage(page)Call when the user changes the view, for tracking which are part of the module they drop or subsequence actions occur

AnalyticService.logCustomEvent() method

Log a custom event to track something specific to this module

Signature:

logCustomEvent(key: string, value: string): void;

Parameters

ParameterTypeDescription
keystringThe identifier of the event, should be from a fixed set of possible values
valuestringThe value that distinguishes this events from others with the same key value

Returns:

void

AnalyticService.replay() method

Log when a user completes the experience but choices to redo it

Signature:

replay(): void;

Returns:

void

AnalyticService.setPage() method

Call when the user changes the view, for tracking which are part of the module they drop or subsequence actions occur

Signature:

setPage(page: string): void;

Parameters

ParameterTypeDescription
pagestringAn identifier of the view, should repeat when the same view is seen again

Returns:

void