Get Program Analytics
growsurf_get_campaign_analyticsFetch analytics for your GrowSurf program: participants, referrals, impressions, per-channel shares, and affiliate revenue, commission, and payout metrics when applicable. Pass interval (day, week, or month) for a per-period series. Pass comma-separated include values for previousPeriod, statusCounts, rates, email, or engagement. engagement groups unique active, sharing, repeat, and retained participants by when portal views and share actions occurred. Its coverageStartAt, state, and reason distinguish measured zeroes from partial or unavailable history. Scope the timeframe with days (default 365, max 1825) or an explicit startDate/endDate window. Explicit dates must both be positive Unix timestamps in milliseconds, with endDate >= startDate and a maximum span of 1825 days. timezone and platform apply to engagement only. Targets campaignId if passed, otherwise GROWSURF_CAMPAIGN_ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | ||
| endDate | No | End of the timeframe, positive Unix timestamp in milliseconds. Supply `startDate` too; `endDate` must be >= `startDate` and at most 1825 days later. | |
| include | No | Comma-separated optional data: `previousPeriod`, `statusCounts`, `rates`, `email`, and `engagement`. Combine values when the question needs more than one view. | |
| interval | No | day/week/month adds a per-period `series`; total (default) returns totals only. | |
| platform | No | Client-platform filter for engagement. Defaults to `ALL`. | |
| timezone | No | IANA timezone for engagement interval and distinct-day calculations. Used with `include=engagement`. | |
| startDate | No | Start of the timeframe, positive Unix timestamp in milliseconds. Supply `endDate` too; the window must span at most 1825 days. | |
| campaignId | Yes | Target program (campaign) id for this call. Defaults to GROWSURF_CAMPAIGN_ID when omitted. Program IDs also identify newly created programs without restarting the server. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| No | Sent, delivered, opened, clicked, bounced, and spam complaint metrics for program emails in the requested window. | ||
| rates | No | Derived referral rates, each a ratio from 0 to 1. Present only when `include` contains `rates`. | |
| series | No | Per-period totals in ascending order. Present only when `interval` is `day`, `week`, or `month`. | |
| endDate | No | End of the analytics timeframe, as a Unix timestamp in milliseconds. | |
| analytics | No | Analytics totals: `invites`, `impressions`, `uniqueImpressions`, `participants`, `referrals`, `referralCreditPendings`, `referralCreditExpireds`, per-channel share counts (`emailShares`, `twitterShares`, `copyRefLinkShares`, ...), and for affiliate programs `totalRevenue` and `totalCommissions` (in minor currency units (e.g. cents)) plus `totalCommissionCount` and `uniqueCommissionReferrals`. | |
| startDate | No | Start of the analytics timeframe, as a Unix timestamp in milliseconds. | |
| engagement | No | Opt-in participant engagement grouped by when activity occurred. | |
| statusCounts | No | Status-count breakdowns: dashboard-aligned reward counts, and for affiliate programs `affiliateStatus`, `commissionStatus`, and `payoutStatus` (counts and amounts in minor currency units (e.g. cents)). Present only when `include` contains `statusCounts`. | |
| previousPeriod | No | Totals for the equal-length window immediately before the requested one (`analytics`, `startDate`, `endDate`). Present only when `include` contains `previousPeriod`. |