File

core/product-experience/user-engagements.service.ts

Index

Properties
Methods

Constructor

constructor(document: Document, userPreferencesService: UserPreferencesService, gainsightService: GainsightService)
Parameters :
Name Type Optional
document Document No
userPreferencesService UserPreferencesService No
gainsightService GainsightService No

Methods

handleUserEngagements
handleUserEngagements()

Handles user engagement settings based on various conditions.

  • Waits for the Gainsight tracking to be loaded.
  • Retrieves the engagement settings.
  • Updates the engagement settings based on the combined observations.
  • Finally, toggles the Gainsight engagements based on the latest userEngagementsEnabled$ value.
Returns : void
toggleGainsightEngagements
toggleGainsightEngagements(isEnabled: boolean)

Toggles the visibility of Gainsight Engagements based on the provided flag.

Parameters :
Name Type Optional Description
isEnabled boolean No
  • A flag indicating whether Gainsight Engagements should be visible.
Returns : void
updateUserEngagementPreference
updateUserEngagementPreference(isEnabled: boolean)

Updates the user's preference for Gainsight Engagements.

Parameters :
Name Type Optional Description
isEnabled boolean No
  • The new value for the user's engagement preference.
Returns : void

Properties

Readonly HIDE_GAINSIGHT_BOT_STYLE_ID
Type : string
Default value : 'hide-gs-bot'
Readonly USER_PREFERENCES_GAINSIGHT_ENGAGEMENTS_KEY
Type : string
Default value : 'gainsightBotEnabled'
Readonly userEngagementsEnabled$
Type : BehaviorSubject<boolean>
Default value : new BehaviorSubject(false)

results matching ""

    No results matching ""