Skip to main content

Read the Analytics Dashboard win-back drill-down

Premium Intermediate

Who cancelled but is still checking the feed, and how many did on each day: the two halves of the Analytics screen’s /analytics/winback sub-screen, which core’s win-back chip on the Subscribers screen opens. Both take show_id, scope and tier_slug, with the same permission and 403 as the other Analytics Dashboard routes. The list reads core only through benecaster_get_winback_leads(), so with no days its total is the chip’s count.

  • The list’s window always ends now: days counts back from today and is capped at the feed request log’s retention. Leave it out to match the chip.
  • A lead names a WordPress account (name, email). Show it to administrators only, and keep it out of anything that leaves the site.
  • The trend changes source at log_from. Before it, rollup days count every check-in with a revoked link, followers and resubscribers included, and have no tier, so label the two differently and never join them into one line.
  • null is a day with no record, not 0.
  • The filters’ $args are show_ids, window_days, tier_slug and app (list), and show_ids, date_from, date_to and tier_slug (trend). A non-array return is ignored.

Code

const base = window.benecasterAnalyticsDashboard.apiUrl;
const headers = { 'X-WP-Nonce': window.benecasterAdmin.nonce };
const list = await ( await fetch( base + 'analytics/winback?show_id=12&days=14&app=Overcast', { headers } ) ).json();
if ( ! list.available ) {
    // The feed request log is switched off: no data, not "nobody".
}
// list.total → everyone in the last 14 days; list.by_tier / by_app / by_show count them all
// list.count and list.leads → only those left after tier_slug and app
const trend = await ( await fetch( base + 'analytics/winback/trend?show_id=12&date_from=2026-09-01&date_to=2026-10-28', { headers } ) ).json();
for ( const p of trend.points ) {
    // p → { day: '2026-09-29', source: 'log', tokens: 2, polls: 6 }; never add p.tokens across days
}

View on GitHub →

Hooks Used

Need this built rather than just documented? See our services →