Install live chat via Google Tag Manager
If your site already loads Google Tag Manager (GTM), you can install message.com chat with a Custom HTML tag in five minutes. No code changes to the site itself.
Before you begin
- GTM already installed on the site (you should see
gtm.startin View Source). - Edit access to the GTM container.
- Your install snippet from
Settings → Chats → Installationin message.com.
HTML
<script>
(function(d,s,o){
var j=d.createElement(s);j.async=1;j.src='https://app.message.com/widget.js';
j.dataset.workspace=o;
d.head.appendChild(j);
})(document,'script','YOUR_WORKSPACE_ID');
</script>1. Open your GTM workspace
- Sign in to tagmanager.google.com.
- Pick the container for your site.
- You should see the Workspace view with Tags and Triggers in the left nav.
2. Create a Custom HTML tag
- Open Tags. Click New.
- Name the tag
message.com chat. - Click Tag Configuration → Custom HTML.
- Paste the snippet into the HTML field.
- Leave the legacy Support document.write option unchecked.
3. Set the trigger
- Click Triggering.
- Choose All Pages (the built-in trigger).
- Click Save.
For an SPA, All Pages fires on the initial pageview. The widget bundle is route-agnostic and survives client-side navigation, so you do not need a History Change trigger.
4. Preview, then publish
- Click Preview. GTM opens Tag Assistant on your site.
- Confirm the new tag fires on Container Loaded.
- Return to GTM. Click Submit, name the version (e.g.,
v1 add message.com chat), and Publish.
5. Verify the install
- Open the site in a private window (no Tag Assistant).
- The launcher appears in the bottom-right within two seconds.
- Open the browser console. Confirm the
[message]startup log. - Send a test message. The conversation lands in
app.message.com.
Common pitfalls
- Consent Mode v2. If GTM is wired to Consent Mode, the tag may be blocked until the visitor accepts the relevant consent category. Either set Consent Settings → No additional consent required on this tag, or add the right consent category. Chat is generally considered functional.
- Cookie banner blocks the launcher. Some cookie banners stretch the full viewport, hiding the launcher. Either raise the launcher z-index, or move the banner.
- GTM container not on the page. The Custom HTML tag only runs when the container itself loads. Double-check the container snippet is in
<head>on every page. - Tag pause. Confirm the tag's Tag firing options are set to Once per page (default).
Next steps
- Identify logged-in users.
- Track chat-to-paid conversion with GTM data layer events.
- Customise the widget.