Sites

The install tag for a site

Returns the script URL and the ready-to-paste tag. Scope read, not sites:write: the snippet is public information (it ends up in the page source), and shared users may install tracking too. type selects a widget instead of the tracker: a hobby site gets the bundled /t/ build, which counts as well as draws, a paid site the widget-only build — its counting is the tracker tag it installs separately.

get/sites/{id}/snippet

Request

Query parameters

type'globe' | 'live-users' | 'map' | 'countries'

Omit for the tracking script.

Response

The install URL and snippet.

site_idinteger required
script_urlstring required
snippetstring required

The tag to paste, ready as it stands — install it verbatim rather than rebuilding it from script_url. A hobby site's tag carries a data-id attribute as well: its script is a /t/ bundle addressed by hash, and that attribute is the only place the counter inside it can read the site id. A tag for a paid site needs no attributes.

Example response

{
  "snippet": "<script defer src=\"https://cdn.statable.com/js/3195799/s.js\"></script>"
}

Changes

No recorded changes to this operation across all 1 revision of this API.