core/product-experience/gainsight.service.ts
A service to manage the Gainsight integration. It allows to load the tag and
constructor(appState: AppStateService, options: OptionsService, cookieBannerService: CookieBannerService, userPreferencesService: UserPreferencesService, translateService: TranslateService)
|
||||||||||||||||||
Parameters :
|
Async getGainsightKey |
getGainsightKey()
|
Returns :
unknown
|
identify | ||||||||||||
identify(sendPiiData: boolean, identifyData: IdentifyData)
|
||||||||||||
Identifies the user/account at Gainsight.
Parameters :
Returns :
void
|
isCustomBranding |
isCustomBranding()
|
Determines if custom branding is enabled based on the presence of a brand logo.
Returns :
boolean
|
isGainsightDisabledAtTenantCustomProperties | ||||||||
isGainsightDisabledAtTenantCustomProperties(customProperties: ICustomProperties)
|
||||||||
Checks if Gainsight is disabled based on tenant custom properties.
Parameters :
Returns :
boolean
|
Async isGainsightPreferenceDisabledInUserPreferences | ||||||||
isGainsightPreferenceDisabledInUserPreferences(preferenceName: string)
|
||||||||
Checks if the specified Gainsight preference is disabled in user preferences.
Parameters :
Returns :
Promise<boolean>
A promise that resolves to |
isTrackingDisabled |
isTrackingDisabled()
|
Determines if tracking is disabled based on the application options.
Returns :
boolean
|
Async loadTag | ||||||||||||
loadTag(currentTenant: ICurrentTenant, sendPiiData: boolean)
|
||||||||||||
Load the script tag and calls the identify function to start the tracking.
Parameters :
Returns :
any
|
setFunctionalCookie | ||||||||
setFunctionalCookie(value: boolean)
|
||||||||
Sets the state of the functional cookie.
Parameters :
Returns :
void
|
setGlobalContext |
setGlobalContext()
|
Sets the global context for Gainsight with the current application name. The global context can be utilized by Gainsight for various purposes, such as segmenting users.
Returns :
void
|
transformUserRolesToStr | ||||||
transformUserRolesToStr(userRoles?: IIdentified[])
|
||||||
Parameters :
Returns :
string
|
translateToEnglish | ||||||
translateToEnglish(textToTranslate: string)
|
||||||
Parameters :
Returns :
string
|
triggerEvent | ||||||||||||
triggerEvent(eventName: string, props?: PxEventData)
|
||||||||||||
Triggers an event to be recorded by Gainsight PX. This method calls the Gainsight PX's tracking mechanism to log a specific event along with its associated properties.
Parameters :
Returns :
void
|
updateUserAttribute | ||||||||||||
updateUserAttribute(name: string, value: string | Date | number | boolean)
|
||||||||||||
Updates a specific user attribute in the Gainsight global scope. This method interfaces with the Gainsight global object to set a user's specific attribute with a provided value.
Parameters :
Returns :
void
|
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. |
trackingLoaded$ |
Type : Subject<boolean>
|
Default value : new Subject()
|
Readonly USER_PREFERENCES_GAINSIGHT_ENGAGEMENTS_KEY |
Type : string
|
Default value : 'gainsightBotEnabled'
|
The name of the key remained unchanged, but applies to all engagements. |
Readonly USER_PREFERENCES_GAINSIGHT_KEY |
Type : string
|
Default value : 'gainsightEnabled'
|
Gainsight is activated only when the cookie banner is present. If functional cookies are enabled, both personally identifiable information (PII) and required data are sent. Otherwise, only the required data is transmitted during the identity step execution. |
tagFunction |
gettagFunction()
|
Returns the tag global function which can be used to identify user or add special events. |