Skip to main content

trackAction

Send user action events for analytics.

Overview

The trackAction method is called when the user does something (e.g. clicks a key play or selects a panel item). For events related to when something is seen or rendered to the user, see trackImpression.

In a multi-event session, we fire multiple action events, one for each respective event.

Method Signature

trackAction(action: ActionTrackEvent): void;

Parameters

ParameterTypeDescription
actionActionTrackEventA union type of action events. This includes things like key_plays_clicked or bets_clicked

Return Value

This method does not return a value.

Example

export type PanelClickAction = {
name: string; // key_plays_clicked
e0_kingdom: 'panel';
e1_phylum: 'engage';
/**
* Panel Type
*/
e2_class: string;
/**
* Panel ID.
*/
e3_order: string;
/**
* Panel Name
*/
e4_family: string;
/**
* Additional metadata for the panel click action.
*/
metadata: Metadata;
};

export type ActionTrackEvent = (
PanelClickAction |
// other types of User Actions
);

class Delegate implements IMaestroEventDelegate {
trackAction(action: ActionTrackEvent) {
console.log('[Analytics Action Event]', action.name);
}
}

Notes