Skip to main content

AI Chat: Ask Questions of Your Live GTM Container

The AI Chat reads your real GTM container and GA4 property before it answers, shows every lookup it made, and gates any change behind a draft workspace or an approval card.

Most questions about a GTM container are small. Which tags fire on purchase? Is there anything still pointing at the old Universal Analytics property? Why does the add_to_cart event show up in preview but not in GA4? Answering any of them means clicking through tags, triggers and variables, cross-checking the GA4 admin, and holding the whole picture in your head. Twenty minutes for a question that should take one.

The AI Chat in AI Tag Manager is built for that kind of question. It is connected to the container and GA4 property you choose, it reads the real configuration through the Tag Manager and Analytics APIs before it answers, and it shows you every lookup it performed so a claim like "you have three tags with no firing trigger" is visibly backed by a read that happened. This post walks through what it can see, how it handles changes, and how usage is counted against your plan.

The chat reads your live container, not a description of it

The empty state of the chat says it plainly: "I am connected to your container, so I answer from what is actually configured rather than from guesswork." When you ask a question, the assistant is given the ids of the account, container and workspace you selected, and it calls tools against the GTM API to fetch what it needs. The tool names follow a noun and verb pattern, and the panel translates them into plain phrases while they run: "Reading your tags", "Checking a trigger", "Reading your built-in variables", "Reading your versions".

The nouns it can read cover the whole container: tags, triggers, variables, built-in variables, folders, accounts, containers, workspaces, versions, environments, templates, server clients, transformations, zones and user permissions. Server-side containers are covered by the last few. On the GA4 side the same pattern applies to property configuration and reporting.

Three orchestrator-owned tools sit on top of the raw reads: "Auditing the container", "Exporting the container", and "Installing the official template", which imports a gallery template when a workflow needs one.

Every lookup is shown, so you can check the answer

Each assistant reply carries a list of the tool calls it made, with a running, ok or failed status and a short summary. A model asked about a container it cannot see will produce a fluent, plausible answer. A model that has to fetch the tag list first will either show you the fetch or show you that it failed. The trace is the first thing to look at when an answer surprises you.

The context bar reinforces this. When the pickers are set it reads "Connected to" followed by the container and workspace names. The workspace is named on purpose: an answer of "no tags" from the wrong workspace looks identical to the right one until you can see which was read. Until something is selected, the bar says "Pick a container to get started".

Choosing the account, container, workspace or property

The chat has its own pickers. Choosing up front means the ids in the prompt are the ones you pointed at, not the ones the model matched a name against.

For GTM there are three pickers: "Select an account", then a container picker with a search field labelled "Search by name or GTM-ID", then a workspace picker. A lookup field accepts "GTM-ABC1234, a numeric id, or a Tag Manager URL" if you have the id but not the account. For GA4 there is a single "Select a property" picker, and "Reload these lists" refetches everything.

The selection is seeded from whatever container the rest of the app has selected, but it is the chat's own. Switching container here to ask a quick question does not move the app-wide selection, so it cannot quietly retarget the Container Audit tab you have open next door.

How to use it, step by step

  1. Open /ai-chat. You need to be signed in with a Google account that has access to the containers you want to ask about. If no Google account is connected, the service returns a "Connect your Google account" message rather than an empty answer.
  2. Choose GTM or GA4 as the product. The composer placeholder changes to match: "Ask about your container, tags, triggers, or variables" or "Ask about your GA4 property, events, or reports".
  3. Set the pickers until the context bar shows a green dot and "Connected to" your container and workspace, or your property.
  4. Type a question or click a starter card. Enter sends, Shift+Enter adds a line. While the answer streams, the send button becomes "Stop generating".
  5. Read the tool trace under the reply. If a lookup failed, the answer was written without that data.
  6. Use "Save as" under a reply that contains a table to export it, or ask a follow-up. "Show past conversations" on the left keeps every thread you have started.
  7. Click "New chat" to start over. Past conversations stay in the list and memories are not affected.

Starter questions and guided workflows

The empty state offers four starters per product. For GTM they are "What is in my container right now?", "Which tags are paused or have no firing trigger?", "Why might my purchase tag not be firing?" and "Audit this container and show me the errors first." For GA4: "Which key events are configured on this property?", "Show me sessions by channel for the last 28 days.", "What custom dimensions and metrics exist?" and "Is enhanced measurement on, and what is it collecting?"

Each maps to something the tools can verify. "Which tags are paused or have no firing trigger?" is a read of the tag list plus a check of each tag's firing trigger ids, the kind of cross-reference that is tedious in the GTM interface and trivial for a tool call. The purchase tag question is the everyday version of the silent tag failure problem.

Below the starters, a section labelled "Guided workflows" lists slash commands supplied by the chat service, shown as buttons like /name with a description on hover. Clicking one expands the command into a full prompt using your selected account and container ids and sends it. The list comes from the server, so it varies by deployment.

Making changes: drafts, approval cards and typed confirmations

The chat can write, and the safeguards around writing are the most careful part of the tool. A header badge reads "Checking permissions" until the backend answers a capability check, then "Read-only" or "Can edit the draft workspace". The panel refuses to claim read-only when it merely could not reach the backend.

Where a change lands decides how it is handled. The code names three surfaces:

SurfaceLabel on the cardWhat happens
gtm_draftDraft workspaceTags, triggers and variables are written straight into the workspace you selected. Nothing is live until you publish a version yourself.
gtm_liveLive containerAnything with no draft behind it, such as container settings, stops for an approval card first.
ga4_liveLive GA4 propertyGA4 has no draft. The change takes effect on the property as soon as it succeeds, so it always asks first.

An approval card shows the tool name, a summary, the surface badge and a "Change details" control. The button reads "Approve", or "Delete" for a delete, or "Archive" for a GA4 archive. Deletes require you to type the word DELETE; archives require ARCHIVE. The GA4 archive warning is honest about the API: "There is no un-archive in the GA4 API, so this cannot be undone here or in the GA4 interface." Once decided, the card stays in the thread marked "Approved" or "Declined".

This is the discipline the validate before production post argues for: drafts are cheap and reversible, publishing is not, and the boundary should be impossible to miss.

Connecting GTM and GA4 in one conversation

Next to the context bar is a chip for the other product. In a GTM chat it is labelled "GA4", in a GA4 chat it is "GTM". The hover text from the GTM side: "Create GA4 events end to end: the selected GA4 property supplies the Measurement ID for the GA4 tags this chat builds, and the event can be registered as a key event."

The chip is opt-in and per conversation. It unlocks the other product's reads plus the writes that workflow needs; deletes and account settings stay in that product's own chat. In practice you can say "create a generate_lead event tag for the form submit trigger and register it as a key event" and have the Measurement ID, the tag, and the key event all come from real ids instead of copy-paste.

Attachments, exports and memory

The paperclip button ("Attach a PDF, spreadsheet, document, or image") accepts PDF, xlsx, docx, txt, markdown, csv, json, html, xml, yaml, js, ts and common image formats. The composer enforces the same ceilings the server does: up to 5 files per message, 15 MB per file, 20 MB in total. An attachment on its own is a real message. This is the way to hand the assistant a client's measurement plan and ask it to compare against what the container actually holds.

When a reply contains a table, a JSON block or a CSV block, a "Save as" row appears under it with Markdown, CSV, Excel and "Print / PDF" options. The Excel export puts each table on its own sheet and names the file after the question you asked.

The "Memory" button opens a panel of what the assistant remembers and applies to future conversations. Each memory has a scope (user, container or property), a source (explicit or inferred) and a "Forget" control. Conversations can be put into groups via "New group", and memory saved in a group applies to every chat in it.

How usage is counted against your plan

The plan is sold in messages, so messages are what you are shown. A small meter in the header reads, on hover, "N of M chat messages used this month on the free plan (T tokens)". Tokens sit in the tooltip because they are what actually varies: a container audit spends far more than "which tags are paused". A plan with no message limit shows just the count with "(unlimited)".

Underneath, the metering lives in the database. Each turn calls a function that increments current_usage_chat by one and adds the prompt and completion tokens to current_usage_tokens. Both are checked before a turn runs against monthly_limit_chat and monthly_limit_tokens. A null limit means uncapped, not zero. Periods roll lazily: each read and write compares the period start to the current month and zeroes the counters if it has moved on.

-- what a turn does, in outline
UPDATE user_plans
   SET current_usage_chat   = current_usage_chat + 1,
       current_usage_tokens = current_usage_tokens + GREATEST(p_tokens, 0)
 WHERE user_id = p_user_id;

As of August 2026 the free plan is 100 chat messages a month. Paid plan limits are set per plan and are described on the pricing page. Only the service role can move the counters.

Two other budgets apply per message rather than per month. If the assistant hits the tool-call limit for one message it stops with "Stopped at the tool-call limit for one message. Ask me to continue." If it hits the time limit it says "Stopped at the time limit for one message. Try a narrower question." A provider rate limit shows a transient "waiting" note and the turn resumes on its own.

Limits, and when to use something else

The chat depends on a separate orchestrator service. If it is unreachable you get a "Chat backend not connected" message naming the address it tried, and no chat. It also needs a Google account with the Tag Manager and Analytics scopes granted.

Reopened conversations restore only what was said. Tool traces and approval cards are deliberately not replayed, because their results are gone and an approval cannot be revisited.

Some jobs are better served by a dedicated tool:

The chat also does not publish a GTM version. Draft writes land in your workspace and publishing stays in the GTM interface, where you can review the diff.

Where to start

Pick the container you know least well, open the chat, and ask the second starter: "Which tags are paused or have no firing trigger?" Check one finding by hand in GTM and you will know how far to trust it within five minutes. From there, the ninety-minute audit playbook gives you a list of questions worth asking on a schedule. The tool is at /ai-chat, and the free plan's 100 messages a month is enough to find out whether it earns a place in your routine.