growsurf_get_campaign_analytics
Retrieve GrowSurf campaign analytics: participants, referrals, impressions, shares, and affiliate revenue. Use interval, include, and date parameters to get totals or per-period series.
Instructions
Fetch 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, or email. The email data reports sent, delivered, opened, clicked, bounced, and spam-complaint counts, rates, and per-email-type metrics. Scope the timeframe with days (default 365, max 1825) or an explicit startDate/endDate window (Unix ms). Targets campaignId if passed, otherwise GROWSURF_CAMPAIGN_ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | ||
| endDate | No | End of the timeframe, Unix timestamp in ms. | |
| include | No | Comma-separated optional data: `previousPeriod`, `statusCounts`, `rates`, and `email`. Combine `email` with `previousPeriod` or a non-total `interval` to receive matching email metrics for those windows. | |
| interval | No | day/week/month adds a per-period `series`; total (default) returns totals only. | |
| startDate | No | Start of the timeframe, Unix timestamp in ms. Use with endDate instead of days. | |
| campaignId | No | Target program (campaign) id for this call. Defaults to GROWSURF_CAMPAIGN_ID when omitted. Pass the `id` returned by growsurf_create_campaign to configure or operate a program you just created, 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. | |
| 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`. |