Prerequisites
- Tag Manager is already on every page of your app.
- Your project key, from Settings → Setup & API Key. It is public and safe to put in a tag.
- A developer who can add two
dataLayer.pushcalls to your app: one after login, one at logout. - If your users must accept a cookie banner before tools like this run, fire the HelpAlive tag only after they accept. See Consent.
- Don’t fire the HelpAlive tag on any page that shows data our Terms of Service say HelpAlive must not receive. Hiding the agent on Controls isn’t enough: activity is still recorded.
How to set up HelpAlive in Tag Manager
1
Add the HelpAlive tag
In Tag Manager, go to Tags → New → Custom HTML. Paste this, replace The setup page shows this tag with your key already in it, under Google Tag Manager.
YOUR_PROJECT_KEY with your key, and set the trigger to All Pages.2
Push the signed-in user to the data layer, from your app
Run this right after login, and on every page load while the user stays signed in. Keep every line: for a value this user doesn’t have, push The user id and the person’s name are always required. A tenant is the company, workspace or account a user belongs to in your app. In a B2B app, the tenant id and name are required too. Push
undefined. Tag Manager keeps the last value pushed. If you leave out a line, that field keeps the previous user’s value.undefined for users with no tenant.3
Create a Data Layer Variable for each field
In Tag Manager, go to Variables → New → Data Layer Variable (version 2). Create one variable for each
helpalive_ name you push, and give it that same name. Tag Manager won’t publish a tag that names a variable you haven’t created.4
Add a second tag that passes it on
Add another Custom HTML tag, triggered by the custom event The first line lets this tag run before the HelpAlive script has loaded. Keep it.
helpalive_identify. Delete the lines for fields you don’t push.5
Forget the user at logout
Push this in your logout code, and wherever your app ends a session. Keep it apart from the identify push.Then add a third Custom HTML tag, triggered by the custom event
helpalive_reset:6
Submit the container
Press Submit in Tag Manager to publish the three tags.
Verify users through Tag Manager
Once your server makes user tokens (see Verify users), pass the token through the data layer. Create a Data Layer Variable namedhelpalive_user_token, then add these lines:
Content Security Policy
If your app sends a Content Security Policy, it must already allow Tag Manager’s Custom HTML tags. Add our sources as well:default-src, add the sources to it instead. Content Security Policy explains each source and shows an example.
Check it works
- Open Tag Manager’s Preview mode on your app and sign in. Check that the
helpalive_identifyevent fires the identify tag. - Open your app, sign in and click around, then come back to Settings → Setup & API Key. Step Add HelpAlive to your app gets a check.
- Log out in Preview mode and check that
helpalive_resetfires the reset tag.
Why won’t Tag Manager publish the identify tag?
The tag names a variable you haven’t created. Create eachhelpalive_ Data Layer Variable, or delete its line from the tag.
Why does the identify tag fire, but nobody is recognized?
HelpAlive received an empty user id. Check that your push setshelpalive_user_id before the helpalive_identify event, and that the Data Layer Variable has exactly that name. To see the reason, add s.setAttribute("data-debug",""); to the loader tag while you test, and read the browser console.
Why does the previous user’s chat stay open after logout?
Thehelpalive_reset push or its tag is missing. Add both, and publish the container.
Next
Identify users
What each field means.
Verify users
Sign each user id on your server.
Troubleshooting
When the agent doesn’t appear.

