Read every Analytics Dashboard route for All my shows
Every benecaster-analytics/v1 data route, downloads, cohort, migration funnel, revenue, donations, win-back and export included, takes an optional scope; the digest routes ignore it. show, the default, reads show_id only; all reads every published, non-archived show where Analytics Dashboard is active, each checked on its own. show_id stays required and is still checked, so a request from a show where the add-on is off is refused (403) before any show is read. The Analytics Dashboard filters receive the shows read in $args['show_ids']. GET benecaster-analytics/v1/analytics/scope says what all covers.
On Benecaster’s admin page the add-on publishes its own REST base as window.benecasterAnalyticsDashboard.apiUrl, which works under every permalink setting.
- On a site with two licences,
allleaves out the shows the other licence holds: the add-on is not active for them under this one. Never sum shows yourself frombenecaster_addon_is_active_for_any_show(). - Tiers are summed by slug across shows, so two shows’
freetiers are one row;analytics/tiers?scope=allnames each slug once, from the first show (by ID) that has it. - Shows left out are counted, never named. Drafts are neither covered nor counted.
Code
const base = window.benecasterAnalyticsDashboard.apiUrl;
const headers = { 'X-WP-Nonce': window.benecasterAdmin.nonce };
const scope = await ( await fetch( base + 'analytics/scope?show_id=12', { headers } ) ).json();
// { show_id: 12, shows: [ { show_id: 12, name: 'Morning Show' }, … ], left_out: { switched_off: 1, archived: 2 } }
const growth = await ( await fetch( base + 'analytics/growth?show_id=12&scope=all&date_from=2026-10-01&date_to=2026-10-30', { headers } ) ).json();
Need this built rather than just documented? See our services →