File

core/product-experience/gainsight.service.ts

Description

A service to manage the Gainsight integration. It allows to load the tag and

Index

Properties
Methods
Accessors

Constructor

constructor(document: Document, appState: AppStateService, options: OptionsService, cookieBannerService: CookieBannerService, userPreferencesService: UserPreferencesService, translateService: TranslateService)
Parameters :
Name Type Optional
document Document No
appState AppStateService No
options OptionsService No
cookieBannerService CookieBannerService No
userPreferencesService UserPreferencesService No
translateService TranslateService No

Methods

Async canEditProductExperienceSettings
canEditProductExperienceSettings()
Returns : Promise<boolean>
Async getGainsightKey
getGainsightKey()
Returns : unknown
identify
identify(user, tenant, instanceId, versionUI?, versionBE?)

Identifies the user/account at Gainsight.

Parameters :
Name Optional Description
user No

The user which is given to Gainsight.

tenant No

The tenant which is given to Gainsight.

instanceId No
versionUI Yes

The UI version used.

versionBE Yes

The BE version used.

Returns : void
Async isGainsightPreferenceDisabledInUserPreferences
isGainsightPreferenceDisabledInUserPreferences(preferenceName: string)
Parameters :
Name Type Optional
preferenceName string No
Returns : Promise<boolean>
Async loadTag
loadTag(currentTenant, identify)

Load the script tag and calls the identify function to start the tracking.

Parameters :
Name Optional Default value Description
currentTenant No

The current tenant.

identify No true

If set to false, only the tag is loaded.

Returns : any
setFunctionalCookie
setFunctionalCookie(value: boolean)
Parameters :
Name Type Optional
value boolean No
Returns : void
shouldLoadGainsightTag
shouldLoadGainsightTag(customProperties: ICustomProperties)

Checks if the Gainsight's tag should be loaded. The decision to load Gainsight will depend on custom properties and functional cookies.

Parameters :
Name Type Optional Description
customProperties ICustomProperties No

Tenant's customProperties.

Returns : boolean
switchKnowledgeHubBotVisibility
switchKnowledgeHubBotVisibility(showGainsightBot: boolean)
Parameters :
Name Type Optional
showGainsightBot boolean No
Returns : void
translateToEnglish
translateToEnglish(textToTranslate: string)
Parameters :
Name Type Optional
textToTranslate string No
Returns : string
triggerEvent
triggerEvent(eventName: string, props?: object)
Parameters :
Name Type Optional
eventName string No
props object Yes
Returns : void

Properties

Readonly HIDE_GAINSIGHT_BOT_STYLE_ID
Type : string
Default value : 'hide-gs-bot'
tagFunction$
Default value : new BehaviorSubject(null)

A subject that emits the tag function as soon as a new tag is set.

Readonly USER_PREFERENCES_GAINSIGHT_BOT_KEY
Type : string
Default value : 'gainsightBotEnabled'
Readonly USER_PREFERENCES_GAINSIGHT_KEY
Type : string
Default value : 'gainsightEnabled'

Accessors

tagFunction
gettagFunction()

Returns the tag global function which can be used to identify user or add special events.

results matching ""

    No results matching ""