Banner

Hierarchy

  • Banner

Index

Properties

id

id: string

Analytics / tracking string.

isControl

isControl: boolean

Whether this banner is a control banner.

placementId

placementId: string

The placement ID this banner is matched to.

properties

properties: PropertiesJson

Properties of this object.

Avoid accessing these properties directly. Instead, prefer using the getStringProperty, getBooleanProperty, getNumberProperty, getImageProperty and getJsonProperty methods which ensure type safety and to avoid breaking changes in the future.

Methods

getBooleanProperty

  • getBooleanProperty(key: string): boolean | null
  • Get value of a property of type boolean.

    Parameters

    • key: string

      The key of the property.

    Returns boolean | null

    The value of the property if the key is found and is of type boolean. If the key is not found or if there is a type mismatch, this method will return a null.

getImageProperty

  • getImageProperty(key: string): string | null
  • Get value of a property of type image.

    Parameters

    • key: string

      The key of the property.

    Returns string | null

    The string value of the image url if the key is found and is of type image. If the key is not found or if there is a type mismatch, this method will return a null.

getJsonProperty

  • Get value of a property of type JSON.

    Parameters

    • key: string

      The key of the property.

    Returns JsonPropertyValue | null

    The value of the property if the key is found and is of type JSON. If the key is not found or if there is a type mismatch, this method will return a null.

getNumberProperty

  • getNumberProperty(key: string): number | null
  • Get value of a property of type number.

    Parameters

    • key: string

      The key of the property.

    Returns number | null

    The value of the property if the key is found and is of type number. If the key is not found or if there is a type mismatch, this method will return a null.

getStringProperty

  • getStringProperty(key: string): string | null
  • Get value of a property of type string.

    Parameters

    • key: string

      The key of the property.

    Returns string | null

    The value of the property if the key is found and is of type string. If the key is not found or if there is a type mismatch, this method will return a null.

getTimestampProperty

  • getTimestampProperty(key: string): number | null
  • Get value of a property of type datetime as a Unix timestamp (milliseconds).

    Parameters

    • key: string

      The key of the property.

    Returns number | null

    The Unix timestamp (milliseconds) value of the property if the key is found and is of type datetime. If the key is not found or if there is a type mismatch, this method will return a null.