Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CleanInsights

Hierarchy

  • CleanInsights

Index

Constructors

constructor

  • Parameters

    • configuration: Configuration | ConfigurationData
       The Configuration provided as a `Configuration` object or as a plain dictionary.
      
    • Optional store: string | Store

    Returns CleanInsights

Properties

Readonly conf

Accessors

campaignConsents

  • get campaignConsents(): string[]
  • Returns string[]

featureConsents

  • get featureConsents(): string[]
  • Returns string[]

Methods

denyCampaign

  • denyCampaign(campaignId: string): null | CampaignConsent
  • Parameters

    • campaignId: string

    Returns null | CampaignConsent

denyFeature

  • denyFeature(feature: Feature): FeatureConsent
  • Parameters

    Returns FeatureConsent

getCampaignConsentByIndex

  • getCampaignConsentByIndex(index: number): null | CampaignConsent
  • Parameters

    • index: number

    Returns null | CampaignConsent

getCampaignIfGood

  • getCampaignIfGood(campaignId: string, debugString: string): null | Campaign
  • Parameters

    • campaignId: string
    • debugString: string

    Returns null | Campaign

getFeatureConsentByIndex

  • getFeatureConsentByIndex(index: number): null | FeatureConsent
  • Parameters

    • index: number

    Returns null | FeatureConsent

grantCampaign

  • grantCampaign(campaignId: string): null | CampaignConsent
  • Parameters

    • campaignId: string

    Returns null | CampaignConsent

grantFeature

  • grantFeature(feature: Feature): FeatureConsent
  • Parameters

    Returns FeatureConsent

isCampaignCurrentlyGranted

  • isCampaignCurrentlyGranted(campaignId: string): boolean
  • Parameters

    • campaignId: string

    Returns boolean

measureEvent

  • measureEvent(category: string, action: string, campaignId: string, name?: string, value?: number): void
  • Track an event.

    Parameters

    • category: string
    • action: string
    • campaignId: string
    • Optional name: string
    • Optional value: number

    Returns void

measureVisit

  • measureVisit(scenePath: string[], campaignId: string): void
  • Track a scene visit.

    Parameters

    • scenePath: string[]
    • campaignId: string

    Returns void

persist

  • persist(): 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

requestConsentForCampaign

  • requestConsentForCampaign(campaignId: string, consentRequestUi: ConsentRequestUi, completed?: (granted: boolean) => void): string
  • Parameters

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

          • granted: boolean

          Returns void

    Returns string

requestConsentForFeature

  • requestConsentForFeature(feature: Feature, consentRequestUi: ConsentRequestUi, completed?: (granted: boolean) => void): string
  • Parameters

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

          • granted: boolean

          Returns void

    Returns string

testServer

  • testServer(done?: (error?: Error) => void): void
  • 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 and it will undermine your privacy promise to your users!

    Parameters

    • Optional done: (error?: Error) => void
       Callback, when the operation is finished, either successfully or not.
      
        • (error?: Error): void
        • Parameters

          • Optional error: Error

          Returns void

    Returns void

Generated using TypeDoc