trackImpression
Send Impression Events.
Overview
The trackImpression method is called when something is seen or rendered to the user (i.e. panel-view). For events related to when the user does something, see trackAction
Method Signature
trackImpression(impression: ImpressionTrackEvent): void;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| action | ImpressionTrackEvent | A union type of impression events. This includes things like panel_view | 
Return Value
Does not return a value.
Example
export type Metadata = Record<string, unknown>;
export type Kingdom = 'panel';
export type Phylum = 'view' | 'engage' | 'collapse';
export type PanelViewAction = {
  name: 'panel_selected';
  e0_kingdom: Kingdom;
  e1_phylum: Phylum;
  /**
   * Panel Type
   */
  e2_class: string;
  /**
   * Panel ID
   */
  e3_order: string;
  /**
   * Panel Name
   */
  e4_family: string;
  /**
   * Additional metadata for the panel view action.
   */
  metadata: Metadata;
};
export type ImpressionTrackEvent = (
  PanelViewAction |
  // other types of user impressions
);
class Delegate implements IMaestroEventDelegate {
  trackImpression(impression: ImpressionTrackEvent) {
    console.log('[Analytics Impression Event]', impression.name);
  }
}