Skip to developer documentation
Browse developer documentation
API documentation / Websites

Websites

Get tracking script

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

GET/api/v1/sites/{site}/script

Access: OAuth analytics:read + sites:write · workspace owner/admin · Permission details

Replace {site} with a real website ID or domain from List websites.

Query parameters

Query parameters
FieldTypeDescription
formatstringInstallation format.

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

Default: html.

Request examples

Examples run from your server or terminal. Configure ATTRIBOO_TOKEN privately for authenticated requests. Replace example website IDs and values with your own. The examples make real requests when you run them.

cURL request
curl "https://www.attriboo.com/api/v1/sites/site_example/script?format=html" \
  -H "Authorization: Bearer $ATTRIBOO_TOKEN"

Response

Illustrative response. Fields below are inside the data object. Optional coverage, notes and continuation fields vary by report.

Response 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.
JSON response
{
  "status": "success",
  "data": {
    "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."
  }
}

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.