API reference / Analytics
Get the analytics site
The workspace's website as analytics sees it: the script tag to install, the domain, what analytics excludes and the main KPI. It also gives the time zone of reports, and whether any visit arrived yet. The first call sets the site up from the workspace's website.
/api/v1/analytics/siteOther ways to call it
troopy analytics sitetroopy_get_analytics_siteResponse
200 · application/jsondata*object23 properties
siteId*stringThe public id that the tracking script sends
domain*stringThe root domain: every subdomain counts too
allowedHostnames*array<string>Other domains that count as this site
cookieless*booleanattackMode*booleanStricter bot filters, for a site under attack
replays*booleanSession replays and heatmaps of a share of the visits (PATCH /session-settings). The tag carries data-replay with the share
replaySample*numberThe share of visits that replays record, 0.01 to 1
exclude*object4 properties
paths*array<string>Paths that analytics never counts. /admin is that page only, and /admin/* is every page under it
At most 50 items
ips*array<string>At most 50 items
countries*array<string>ISO 3166-1 alpha-2 codes
At most 250 items
hostnames*array<string>At most 50 items
kpi*stringWhat the dashboard leads with: revenue, mrr, or the name of a goal
color*enum<string>The colour of revenue on the charts and cards of the dashboard
redcoralpinkambergreentealblueindigovioletslate
script*stringThe tag to paste into the <head> of every page
timezone*stringThe days of reports start at midnight in this time zone
share*object | nullThe read-only dashboard that anyone with the link can open
4 properties
url*stringAdd ?embed=true to show it in a frame of another page
until*string | nullWhen the link stops opening, or null when it never stops
password*booleanWhether the link asks for a password
segment*string | nullThe saved segment that the link always shows, or null for all visitors
hasEvents*booleanWhether the script sent anything yet
weeklyReport*booleanA weekly summary by email to the owners and admins of the organization, on Monday morning
monthlyReport*booleanA monthly summary by email, on the morning of the first day of the month
reportEmails*array<string>More addresses that get the reports and the traffic alerts, besides the owners and admins
spikeAlerts*booleanAn email to owners and admins when visits jump well above the usual
dropAlerts*booleanAn email to owners and admins when the pageviews of the last 12 hours fall far under the usual
githubRepo*string | nullThe repo whose commits show as notes on the chart (owner/name)
githubBranch*string | nullThe branch of that repo whose commits show. Null: the default branch
mentions*objectWords and X handles that Troopy finds on X and Reddit, as well as the domain. Posts that name them show as notes on the chart
2 properties
keywords*array<string>handles*array<string>proxy*object | nullThe managed proxy: the script and events on a subdomain of the site, so ad blockers leave them alone
5 properties
host*stringThe subdomain of the site that serves the script, like a.acme.com
status*enum<string>pending until a check finds the CNAME and the script over HTTPS
pendingactivefailed
error*string | nullWhat the last check found missing
checkedAt*string | nulltarget*stringWhere the CNAME of the host points, like proxy.troopy.ai