Set website tracking
set_website_trackingAdd 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
| Name | Required | Description | Default |
|---|---|---|---|
| site_id | Yes | The id of the website site | |
| workspace_id | No | Optional: 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_id | No | GTM-XXXXXXX or G-XXXXXXXXXX, or a snippet naming one; null removes it | |
| consent_banner | No | true to ask visitors before any tag loads |