window.gwhale instance.
init
This method needs to be called before calling any other methods below.
- For single page applications (SPA) this method should only be called when page is initially loaded.
- For multipage application this method should be called on every page load
string
required
Code of the app environment to initialize. This can be found in our dashboard under
Settings > Environments
or Settings > Installation.
object
Initialization options, including user, company and membership properties.
Example
track
Used to programmatically track user events that are not taggable or automatically captured by GuideWhale.string
required
The name of the event to track.
object
Contextual properties associated with this event.
Example
onRedirect
Used to handle redirects without a page reload when GuideWhale content wants to redirect to another page.(url: string) => void
required
Handler function to handle redirects without a page reload when GuideWhale content wants to redirect to another page.
Example
reset
Remove currently identified user and company. You will have to call theinit function again to re-identify the user.
Example
setUserProperties
Helper function to set user properties of currently identified user without having to call theidentify function again.
object
required
New property values.
Example: set value
Example: add to existing property value
Example: subtract from existing property value
setCompanyProperties
Helper function to set company properties of currently identified user without having to call theidentify function again.
object
required
New property values.
Example: set value
Example: add to existing property value
Example: subtract from existing property value
setMembershipProperties
Helper function to set user company membership properties of currently identified user without having to call theidentify function again.
object
required
New property values.
Example: set value
Example: add to existing property value
Example: subtract from existing property value