Skip to developer documentation
Browse developer documentation
CLI documentation / Websites

Get a tracking snippet

attriboo sites script

Retrieve a real website's snippet with its saved tracking and consent choices.

Access: OAuth analytics:read sites:write; workspace owner/admin

Options

attriboo sites script options
FieldTypeDescription
--siteRequiredstringWebsite ID or domain from sites list.
--formatstringSnippet format.

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

Default: html.

--jsonbooleanCompact JSON instead of formatted JSON.
--csvbooleanCSV for the main row collection; nested values remain JSON cells. Cannot be combined with --json.

Print the installation snippet

Replace example websites, dates and cursor values with your own. Running these commands makes real requests or changes the local session.

Terminal command
attriboo sites script --site shop.example.com --format html

Example output

Illustrative stdout
<script defer data-auto-identify="false" data-consent="required" data-site-id="site_example" src="https://www.attriboo.com/t.js"></script>

Inspect snippet metadata as JSON

Replace example websites, dates and cursor values with your own. Running these commands makes real requests or changes the local session.

Terminal command
attriboo sites script --site shop.example.com --format html --json

Example output

Illustrative stdout
{"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."}

Output fields

attriboo sites script output 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 data follows the get tracking script API contract. CLI JSON omits the REST envelope.

Behavior and limits

Without --json or --csv, this command prints only the script string. --json returns the full site, domain, format, script, preferences, installation_guide and next fields.

Install the exact snippet once using the matching platform guide. This command does not edit or deploy your website.