Google Tag Manager
Install on your website

Add Asks with Google Tag Manager

Load the Asks AI chat widget through Google Tag Manager with a Custom HTML tag that creates the embed script, fired on DOM Ready on every page.

Learn more about the Asks AI chatbot for websites →

Updated

To load the Asks AI chat widget with Google Tag Manager, create a Custom HTML tag that adds the Asks embed script with a few lines of JavaScript, fire it with a DOM Ready trigger on all pages, and publish the container. Don't paste the plain snippet into the tag: Tag Manager doesn't reliably keep custom data- attributes on the script tags it injects, and without data-widget-key the widget never starts.

Before you start

  • Google Tag Manager's container snippet is already on every page of your site.
  • The Chat widget reads Live at Channels → Chat widget.

Add the tag

Copy your widget key

Open Channels → Chat widget → Deploy, keep Code snippet and HTML, select For website visitors without logins, and copy the snippet. You need the value of its data-widget-key attribute.

Onboarding Put it on your site step with the Embed Code card showing the script tag, including the data-widget-key value, and a Copy button, above the Installation status card
Your widget key is the data-widget-key value in the snippet.
Create a Custom HTML tag

In Tag Manager, go to Tags → New, open Tag Configuration, and select Custom HTML. Paste this code and replace YOUR_WIDGET_KEY with your key:

HTML
<script>
  (function () {
    var s = document.createElement("script");
    s.src = "https://cdn.asks.app/embed.js";
    s.async = true;
    s.setAttribute("data-widget-key", "YOUR_WIDGET_KEY");
    document.body.appendChild(s);
  })();
</script>

The code builds the same script tag as the Asks snippet, so the widget reads its key exactly as it would from your page. Leave Support document.write off.

Fire it on DOM Ready

Under Triggering, add a new trigger, choose DOM Ready as the trigger type, and keep All DOM Ready Events. The widget attaches to the page body, which exists once the DOM is ready. Name the tag, for example "Asks chat widget", and save it.

Preview, then publish

Select Preview, open your site in Tag Assistant, and check that the tag appears under the tags that fired. Then select Submit and Publish.

Verify it works

Open your site in a private window. The launcher appears in the bottom corner, and the Deploy tab's Installation status card reads "Widget detected on" followed by your domain. Send a test message: it lands in your Inbox, and the agent replies when it's on for the Chat widget at AI agent → Deploy.

Chat widget Deploy tab scrolled to the Installation status card, which reads Widget detected on aurelia-skincare.com in green, between the server-side userHash code and the Identity verification (for users with logins) card
Installation status turns green on the first page load with the widget.
Deploy AI Agent page with the AI Agent Status card active and the Deploy to Channels card listing Chat widget switched on and Active, then WhatsApp Business, Instagram, Facebook Messenger, and Telegram with their own switches
The agent answers on your site when Chat widget is on here.

Troubleshooting

The tag fired, but there's no launcher

Open the browser console: the widget logs under an [asks-widget] prefix. A 404 Widget not found on the config request means the key is wrong; a 400 Widget is not active means the Chat widget or Spotlight isn't Live. A Content-Security-Policy error means your site needs the origins in the Content-Security-Policy table.

The widget loads only after visitors accept cookies

Your consent setup holds this tag until the visitor accepts a consent type the tag requires. Check the tag's consent settings in Tag Manager against how your privacy policy treats a support chat.

The snippet is also in my site's code

Load the widget one way only. Remove either the tag or the snippet in your templates.

Logged-in customers

Tag Manager can't sign user ids on your server. For verified, cross-device history, add the logged-in snippet to your site's templates, or call window.AsksWidget.identify() after login; see Logged-in users.

Google Tag Manager steps checked in November 2026 against Google's help article Custom HTML tags.

Chat on WhatsApp