Google Tag Manager
Install the Yaplet chat widget on any site that already runs Google Tag Manager, with one Custom HTML tag. No changes to the site's code.
Overview
If a site already runs Google Tag Manager, the Yaplet chat can be added from there, without touching the site's code: one Custom HTML tag with the Yaplet code, fired on every page, then published. This is also the route for site builders and shops that only offer a field for a Google Tag Manager ID: connect Tag Manager there first, then follow this guide.
Installation Steps
Copy your Yaplet code
In your Yaplet dashboard, go to Brand → Chat widget and open the Install tab. If the tab asks where your website runs, choose Google Tag Manager. Copy the code with the copy button on the code block.
Tag Manager needs the code inside <script> tags, so the code you paste in the next steps must have them.
Create a Custom HTML tag
Go to tagmanager.google.com and open the container of your website. Click Tags, then New. Name the tag (for example Yaplet chat), click Tag Configuration and choose Custom HTML.
Paste the code
In the HTML field, paste the Yaplet code. The code you paste must start with a <script> line and end with a </script> line; if what you copied starts with !function (Yaplet instead, type <script> on a new line before it and </script> on a new line after it. Google asks for JavaScript to always sit inside these tags:
<script>
(your Yaplet code)
</script>
Make it fire on every page
Click Triggering and choose Initialization - All Pages. Every web container has this trigger by default. Then click Save.
Test it in Preview mode (optional)
Click Preview (top right), enter the site's address and click Connect. The site opens in a new window with the unpublished changes, and the chat button should appear in the bottom-right corner. Only your browser sees this preview, not your visitors.
Publish
Click Submit (top right). Leave Publish and Create Version selected, give the version a name (for example "Yaplet chat") and click Publish.
Check your site
Open the site in a new browser tab and reload it. The Yaplet chat button appears in the bottom-right corner. Click it to check that the chat opens.
Troubleshooting
- The changes aren't published — saved changes only show in Preview mode. Click Submit and publish.
- The
<script>tags are missing — open the tag and check that<script>is on the line before the code and</script>on the line after it. - You can't publish — your access may allow editing but not publishing. Ask someone with Publish access to the container to publish it.
- The chat only shows after a visitor accepts cookies — open the tag and go to Advanced Settings → Consent Settings. If Require additional consent for tag to fire is selected, the tag only fires once the visitor has granted the consent types listed there.
- Tag Manager isn't on the page — the tag only runs on pages that load your Tag Manager container. Check that the Tag Manager code is on every page of the site.
- You still see the old page — the browser or the site's cache may show an older copy. Reload, or open the site in a private window.