Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AbstractTrackingProvider<T>

This class is the base class for all tracking providers, it contains the most default setup for configuring a tracking provider. The class should always be extended by another provider class that adds the required provider configuration.

class

AbstractTrackingProvider

Type parameters

  • T

    This should be the interface for the tracking provider options. This usually contains the base configuration.

Hierarchy

Implements

  • IDisposable

Index

Constructors

constructor

Properties

Protected logger

logger: debug

This is the logger instance that can be used to trigger namespaced logs.

Protected providerOptions

providerOptions: T

This is the configuration object that contains all the base information required for initializing the provider.

providerReady

providerReady: Promise<void>

This promise will be resolved or rejected once the provider is ready for usage.

Protected providerReadyRejectMethod

providerReadyRejectMethod: function

This is the reject method that should be triggered if the provider loadings fails for what ever reason.

Type declaration

    • (): void
    • Returns void

Protected providerReadyResolveMethod

providerReadyResolveMethod: function

This is the resolve method that should be triggered once the provider is ready for usage.

Type declaration

    • (): void
    • Returns void

Methods

dispose

  • dispose(): void
  • Destruct this class.

    Returns void

Protected handleApiFailed

  • handleApiFailed(): void
  • Method that is triggered when the api has failed loading

    Returns void

Protected handleApiLoaded

  • handleApiLoaded(): void
  • Method that is triggered when the api is successfully loaded

    Returns void

Protected init

  • init(): void
  • The abstract init method that initializes the tracking provider third party library

    Returns void

isDisposed

  • isDisposed(): boolean
  • After dispose has been called, this method returns true. Use this method to determine whether dispose() should be run again.

    Returns boolean

trackEvent

  • trackEvent(data?: any): Promise<void>
  • The abstract method used on all tracking providers to actually trigger the event tracking

    Parameters

    • Optional data: any

      This is the event data that is send to the tracking provider

    Returns Promise<void>

trackPageView

  • trackPageView(data?: any): Promise<void>
  • The abstract method used on all tracking providers to actually trigger the page view

    Parameters

    • Optional data: any

      This is the page view data that is send to the tracking provider

    Returns Promise<void>

Generated using TypeDoc