HelpAlive object. The calls are identify(), reset(), setConsent(), track(), flush(), shutdown() and init(). Most apps need only the tag, identify() and reset(), as Install the script shows.
Prerequisites
- The HelpAlive tag is in your pages.
- The four queue lines from Install the script run before your first call.
Script tag attributes
identify()
- The script refuses a call only in these cases:
- Neither
userIdnoruserTokennames the user. userIdortenantIdis over 255 characters, or is neither text nor a number.- An id in
userTokenis over 200 characters.
- Neither
- If another required field is missing, the call goes on, and your dashboard has less to show.
- A number in
displayName,roleorplanis turned into text. - A field of the wrong type, or too long, is left out and the call goes on. With
data-debugon the tag, the console says which field. - Returns a promise that resolves once the call is handled. Calls run in the order you make them.
- Calling it again for the same user is safe. Calling it for a different user closes the previous user’s agent first.
reset()
identify(). Activity after reset() waits in the page until the next identify().
setConsent()
Does nothing, and you never need to call it. It stays in the queue lines only so pages that already call it keep working.track()
Records an event of your own with the signed-in user’s activity.
Events tracked before
identify() wait in the page until it runs. Custom properties are stored as you send them, so don’t put personal data in them.
flush()
shutdown()
init() runs again. It doesn’t close an open agent. To close it, call reset() before shutdown().
init()
Most apps never callinit(), because the tag’s data-api-key starts HelpAlive. Call it only if you load the script without data-api-key, once the script has loaded. Never do both, or HelpAlive starts twice.
Set a key to
false to turn that kind of recording off, for example capture: { changes: false }:
The agent uses recent activity to understand what the user just did. Turning kinds off makes its help fit less well.
init() returns a promise, and rejects if apiKey is missing.
Check it works
In the browser console on a signed-in page, runtypeof HelpAlive.init:
"function"means our script has loaded."undefined"means only the queue lines have run.
data-debug to the tag. The browser console then shows what HelpAlive does, and why it refuses a call.
Why is HelpAlive not defined?
A call ran before the queue lines. Put the four queue lines above your first call.Why does a call do nothing?
Either the tag has nodata-api-key, or identify() was refused. Add data-debug to the tag and read the console. Troubleshooting lists each cause.
Next
Install the script
The tag, identify() and reset().
Identify users
Every field, in detail.
Troubleshooting
When the agent doesn’t appear.

