Skip to main content
To install the SDK, please follow the instructions in the installation section. All methods below are called using the loaded window.gwhale instance.

init

This method needs to be called before calling any other methods below.
Used to initialize GuideWhale app environment and identify user, company and their membership.
  • 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
For a detailed parameter guide see the installation section.
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 the init function again to re-identify the user.
Example

setUserProperties

Helper function to set user properties of currently identified user without having to call the identify 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 the identify 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 the identify function again.
object
required
New property values.
Example: set value
Example: add to existing property value
Example: subtract from existing property value