Class CleanInsights

Hierarchy

  • CleanInsights

Constructors

Properties

Accessors

Methods

  • Returns the consent for a given campaign, if any available.

    Parameters

    • campaignId: string

      The campaign ID to get the consent for.

    Returns null | CampaignConsent

    the CampaignConsent for the given campaign or null, if consent unknown.

  • Returns the consent for a given feature, if any available.

    Parameters

    • feature: Feature

      The feature to get the consent for.

    Returns null | FeatureConsent

    the FeatureConsent for the given feature or null, if consent unknown.

  • Parameters

    • campaignId: string

    Returns boolean

  • Track an event.

    Parameters

    • category: string

      The event category. Must not be empty. (e.g. Videos, Music, Games...)

    • action: string

      The event action. Must not be empty. (e.g. Play, Pause, Duration, Add Playlist, Downloaded, Clicked...)

    • campaignId: string

      The campaign ID as per your configuration, where this measurement belongs to.

    • Optional name: string

      The event name. OPTIONAL.

    • Optional value: number

      The event value. OPTIONAL.

    Returns void

  • Track a scene visit.

    Parameters

    • scenePath: string[]

      A hierarchical path best describing the structure of your scenes. E.g. ['Main', 'Settings', 'Some Setting'].

    • campaignId: string

      The campaign ID as per your configuration, where this measurement belongs to.

    Returns void

  • Persist accumulated data to the filesystem/local storage.

    A website should call this in an onUnload event, a Node.JS app should call this when the process exits for whatever reason. (See node-cleanup).

    Returns void

  • Parameters

    • campaignId: string
    • consentRequestUi: ConsentRequestUi
    • Optional completed: ((granted) => void)
        • (granted): void
        • Parameters

          • granted: boolean

          Returns void

    Returns string

  • Parameters

    • feature: Feature
    • consentRequestUi: ConsentRequestUi
    • Optional completed: ((granted) => void)
        • (granted): void
        • Parameters

          • granted: boolean

          Returns void

    Returns string

  • Checks the consent state of a campaign.

    Parameters

    • campaignId: string

      The campaign ID to check the consent state of.

    Returns ConsentState

    the current state of consent.

  • Sends an empty body to the server for easy debugging of server-related issues like TLS and CORS problems.

    DON'T LEAVE THIS IN PRODUCTION, once you're done fixing any server issues. There's absolutely no point in pinging the server with this all the time, it will undermine your privacy promise to your users!

    Parameters

    • Optional done: ((error?) => void)

      Callback, when the operation is finished, either successfully or not.

        • (error?): void
        • Parameters

          • Optional error: Error

          Returns void

    Returns void

Generated using TypeDoc