Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Campaign

Hierarchy

  • Campaign

Index

Constructors

constructor

  • Parameters

    • start: Dayjs | CampaignData
       The start of the campaign. (inclusive)
      
    • Optional end: Dayjs
       The end of the campaign. (inclusive) OPTIONAL if provided via an object as first argument.
      
    • Optional aggregationPeriodLength: number
       The length of the aggregation period in number of days. At the end of a period,
       the aggregated data will be sent to the analytics server.
       OPTIONAL if provided via an object as first argument.
      
    • Optional numberOfPeriods: number
    • Optional onlyRecordOnce: boolean
    • Optional eventAggregationRule: EventAggregationRule

    Returns Campaign

Properties

aggregationPeriodLength

aggregationPeriodLength: number

end

end: Dayjs

eventAggregationRule

eventAggregationRule: string

numberOfPeriods

numberOfPeriods: number

onlyRecordOnce

onlyRecordOnce: boolean

start

start: Dayjs

Accessors

aggregationPeriod

  • get aggregationPeriod(): Duration
  • Returns Duration

currentMeasurementPeriod

  • get currentMeasurementPeriod(): null | { end: Dayjs; start: Dayjs }
  • Returns the current measurement period, aka. the period where NOW is in.

    If NOW is outside any possible period, because the campaign hasn't started, yet, or already ended, will return undefined.

    The first period is defined as aggregationPeriodLength number of days after the start of the campaign.

    Returns null | { end: Dayjs; start: Dayjs }

nextTotalMeasurementPeriod

  • get nextTotalMeasurementPeriod(): null | { end: Dayjs; start: Dayjs }
  • Returns null | { end: Dayjs; start: Dayjs }

Methods

apply

  • apply(event: Event, value?: number): void
  • Apply the eventAggregationRule to the given event with the given value.

    Parameters

    • event: Event
       The event to apply the value to.
      
    • Optional value: number
       The value to apply.
      

    Returns void

toString

  • toString(): string
  • Returns string

Generated using TypeDoc