Skip to main content
Glama

Set website tracking

set_website_tracking
Idempotent

Add Google Tag Manager or Google Analytics to a website, and the cookie banner that asks visitors first. google_tag_id takes a container (GTM-XXXXXXX) or a Google tag (G-XXXXXXXXXX, AW-, DC-), or a pasted snippet it is read from; null removes it; leave it out to keep it. It is live on the website right away, with no preview. SnapHost loads the tag on every page and allows Google's hosts: remove any GTM or gtag snippet a page already has (while the banner is on such a snippet is held back until consent). A first tag turns consent_banner on unless you pass false; with it on, nothing loads until a visitor accepts analytics or marketing, Google tags follow the choice through Consent Mode, and Reject all is as plain as Accept all. A tag from another vendor inside GTM (Meta pixel, LinkedIn, Hotjar) must be set in Tag Manager to require the matching consent: marketing grants ad_storage, ad_user_data and ad_personalization, analytics grants analytics_storage, and every choice pushes the event snaphost_consent with analytics and marketing true or false. It also needs its https hosts added with add_external_origins (paid plans; wss:// cannot be allowed). The banner keeps no record of each choice and writes no cookie policy; do not tell the person they are legally covered. Look: it follows the page's --brand-* tokens and font; site CSS can restyle .snaphost-consent and .snaphost-consent-open, or set --consent-accent (and --consent-on-accent), --consent-surface, --consent-ink, --consent-radius on both, not :root. It speaks Icelandic on a lang="is" page, else English. A page's becomes its Read more link. Own wording or markup: publish _partials/cookie-consent.html with buttons marked data-consent-action="accept-all" and "reject-all" (required: a website publish is refused without them), "choose" and "save", and checkboxes data-consent-category="analytics" and "marketing" inside an element marked data-consent-choices; keep it position: fixed. A page script, inline or src, waits for consent written . A in every page's footer, visible at every width, reopens the banner; without one a pinned Cookie settings button (.snaphost-consent-open) does. A choice keeps the visitor in place. Call with only site_id to read. Editors only; websites only.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "site_id": "<site_id>"
    },
    "name": "set_website_tracking"
  }
}

Input Schema

NameRequiredDescriptionDefault
site_idYesThe id of the website site
workspace_idNoOptional: the workspace to act in, from list_workspaces (the connection reaches the person's personal space and every workspace they are a member of). Required on a write when the connection reaches more than one workspace. Omit to act in the personal space (for an older single-workspace connection, the one workspace it was authorized for).
google_tag_idNoGTM-XXXXXXX or G-XXXXXXXXXX, or a snippet naming one; null removes it
consent_bannerNotrue to ask visitors before any tag loads

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes far beyond the annotations: states the change is live immediately with no preview, that SnapHost strips existing GTM/gtag snippets from pages, that a first tag flips consent_banner on unless false is passed, how Consent Mode maps choices to ad_storage/analytics_storage and pushes snaphost_consent, and that no per-visitor record or cookie policy is kept. It also warns explicitly not to tell people they are legally covered and notes wss:// hosts cannot be allowed — the kind of caveat annotations never carry.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Core behavior is front-loaded and every section is factually relevant, but the single dense paragraph sprawls across styling tokens, i18n, custom partial markup contracts, and footer button requirements. Useful detail, yet an agent must wade through low-priority styling prose (--consent-* variables) that could be tightened or deferred.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Very complete for a 4-parameter write tool with no output schema: it covers safety, consent logic, content transformation, permissions, and theming. The one gap is that the response of a successful write or of the read-only call is never characterized, leaving the agent unsure what comes back.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning: accepted google_tag_id formats (GTM-, G-, AW-, DC-, or a pasted snippet it parses), null removes, omitting preserves the current value, and the first-tag default for consent_banner. Only workspace_id semantics are left entirely to the schema, which already documents them well.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence names a specific verb (Add) and resource (Tag Manager/Analytics tag plus the cookie banner), and the closing 'Call with only site_id to read' distinguishes the read mode from the write mode. An agent can tell this apart from siblings like set_brand_kit or set_render_options without opening another schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit preconditions ('Editors only; websites only') and mode selection ('Call with only site_id to read'), plus routing to add_external_origins when third-party GTM vendors need https hosts. It does not name a competing tool the agent should pick instead, so it falls short of a full when/when-not/alternatives statement.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.