Skip to developer documentation
Browse developer documentation
MCP documentation / Website setup

Read-only tool

get_tracking_script

Retrieve an installation snippet for the actual website and its saved privacy choices.

Access: OAuth analytics:read sites:write, with current workspace owner/admin access. Workspace keys cannot use this tool.

Arguments

get_tracking_script arguments
FieldTypeDescription
formatstringInstallation format.

Values: html, gtm, nextjs, astro, nuxt, jsx, gatsby, docusaurus, drupal.

Default: html.

sitestringWebsite ID or domain. Required when the workspace has more than one website.

Get tracking script

Use this JSON-RPC call through an initialized MCP client. Replace example values with your actual website, dates or confirmed setup details.

MCP tools/call request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_tracking_script",
    "arguments": {
      "site": "site_example",
      "format": "html"
    }
  }
}

Decoded result

Illustrative JSON parsed from the result’s text block.

Decoded JSON result
{
  "site": "site_example",
  "domain": "shop.example.com",
  "format": "html",
  "script": "<script defer data-auto-identify=\"false\" data-consent=\"required\" data-site-id=\"site_example\" src=\"https://www.attriboo.com/t.js\"></script>",
  "preferences": {
    "mode": "standard",
    "consent": "required",
    "captureEmails": false,
    "visitorEstimates": false
  },
  "installation_guide": "https://www.attriboo.com/docs/installation",
  "next": "Install once using the matching platform guide. Publish the change, respect the site's consent setup, then check received activity. The snippet contains no private API key."
}

Result fields

get_tracking_script result fields
FieldTypeDescription
sitestringWebsite ID.
domainstringWebsite domain.
formatstringSelected format.
scriptstringComplete snippet to install once.
preferencesobjectSaved mode, consent, captureEmails and visitorEstimates.
installation_guidestringMatching documentation entry point.
nextstringNext installation step.

The decoded data follows the get tracking script response contract, without the REST envelope.

Full MCP result wrapper
MCP result object
{
  "content": [
    {
      "type": "text",
      "text": "{\n  \"site\": \"site_example\",\n  \"domain\": \"shop.example.com\",\n  \"format\": \"html\",\n  \"script\": \"<script defer data-auto-identify=\\\"false\\\" data-consent=\\\"required\\\" data-site-id=\\\"site_example\\\" src=\\\"https://www.attriboo.com/t.js\\\"></script>\",\n  \"preferences\": {\n    \"mode\": \"standard\",\n    \"consent\": \"required\",\n    \"captureEmails\": false,\n    \"visitorEstimates\": false\n  },\n  \"installation_guide\": \"https://www.attriboo.com/docs/installation\",\n  \"next\": \"Install once using the matching platform guide. Publish the change, respect the site's consent setup, then check received activity. The snippet contains no private API key.\"\n}"
    }
  ]
}

Behavior and limits

Path parameter site is a returned website ID or domain. Requires setup OAuth and workspace owner/admin access, even though this is a GET.

Use the exact returned script: attributes change with saved privacy choices. Publish the installation before verification.

Related documentation