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(appState: AppStateService, options: OptionsService, cookieBannerService: CookieBannerService, userPreferencesService: UserPreferencesService, translateService: TranslateService)
Parameters :
Name Type Optional
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 isGainsightDisabledInUserPreferences
isGainsightDisabledInUserPreferences()
Returns : unknown
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
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

tagFunction$
Default value : new BehaviorSubject(null)

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

Readonly USER_PREFERENCES_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 ""