Skip to main content
GET
/
broadcast-analytics
Broadcast Analytics
curl --request GET \
  --url https://api.flowiq.live/broadcast-analytics \
  --header 'Authorization: Bearer <token>'
{ "success": true, "data": { "broadcastInfo": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "name": "March Promo", "templateName": "march_promo_v2", "createdAt": "2026-03-15T10:00:00Z", "totalRecipients": 1500 }, "deliveryStats": { "sent": 1500, "delivered": 1420, "read": 890, "failed": 80, "deliveryRate": 94.67, "readRate": 62.68 }, "conversionFunnel": { "sent": 1500, "delivered": 1420, "read": 890, "buttonClicked": 63, "optedOut": 4 }, "buttonAnalytics": { "quickReplyButton": "Shop Now", "quickReplyClicks": 29, "quickReplyConversionRate": 3.26 }, "allButtons": [ { "buttonText": "Shop Now", "clicks": 29, "conversionRate": 3.26 }, { "buttonText": "View More", "clicks": 23, "conversionRate": 2.58 }, { "buttonText": "Not Interested", "clicks": 11, "conversionRate": 1.24 } ], "totalButtonClicks": 63, "optOutAnalytics": { "totalOptOuts": 4, "optOutRate": 0.45 }, "revenue": { "totalRevenue": 19302, "currency": "ZAR", "orderCount": 11, "avgOrderValue": 1754.73, "utmCampaign": "31marstockup", "utmCampaigns": [ { "campaign": "31marstockup", "orderCount": 6, "revenue": 10880, "avgOrderValue": 1813.33 }, { "campaign": "31marstockup_vm", "orderCount": 5, "revenue": 8422, "avgOrderValue": 1684.4 } ], "orders": [ { "orderName": "#28556", "totalPrice": 1650, "currency": "ZAR", "orderDate": "2026-04-03T07:35:39+02:00", "financialStatus": "paid", "utmCampaign": "31marstockup_vm" } ] } } }
Retrieve broadcast analytics for your organization. Supports individual broadcast deep-dives (with per-button tracking, opt-out detection, and revenue attribution) or overall date-range aggregations.

Two Modes

The endpoint supports two query modes based on which parameters you provide:
ModeParametersDescription
Individualbroadcast_idDetailed analytics for a single broadcast
Overallstart_date + end_dateAggregated analytics across all broadcasts in a date range

Individual Broadcast Analytics

Pass a broadcast_id to get detailed metrics for a single broadcast, including delivery stats, per-button click tracking, opt-out detection, and Shopify revenue attribution.
curl "https://api.flowiq.live/broadcast-analytics?broadcast_id=a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
  -H "Authorization: Bearer fiq_YOUR_API_KEY"

Response Fields

FieldDescription
broadcastInfoBroadcast metadata (name, template, date, total recipients)
deliveryStatsSent, delivered, read, failed counts with rates
conversionFunnelFunnel from sent → delivered → read → button clicked → opted out
buttonAnalyticsFirst button stats (backward compatible)
allButtonsPer-button breakdown with text, clicks, and conversion rate
totalButtonClicksSum of clicks across all buttons
optOutAnalyticsTotal opt-outs and opt-out rate
revenueShopify revenue attributed to this broadcast via UTM tracking

Per-Button Tracking

All quick reply buttons on the template are tracked individually. The response includes an allButtons array with each button’s text, click count, and conversion rate:
{
  "allButtons": [
    { "buttonText": "Shop Now", "clicks": 29, "conversionRate": 3.26 },
    { "buttonText": "View More", "clicks": 23, "conversionRate": 2.58 },
    { "buttonText": "Not Interested", "clicks": 11, "conversionRate": 1.24 }
  ],
  "totalButtonClicks": 63
}

Opt-Out Detection

Opt-outs are detected from customer responses within 48 hours of the broadcast using multilingual keyword matching:
LanguageKeywords
Englishstop, unsubscribe, opt out, optout
Portugueseparar, pare, cancelar
Spanishdetener, basta
Frencharreter, desabonner
Italianfermare, ferma, annullare, annulla, cancellare
Generalquit, end, cancel

Revenue Attribution

Revenue is automatically attributed by tracing the broadcast’s shortcode through to Shopify orders:
  1. Broadcast button parameter contains a shortcode
  2. Shortcode resolves to a redirect URL with a utm_campaign parameter
  3. Shopify orders with utm_source=whatsapp and a matching utm_campaign are summed
{
  "revenue": {
    "totalRevenue": 19302.00,
    "currency": "ZAR",
    "orderCount": 11,
    "avgOrderValue": 1754.73,
    "utmCampaign": "31marstockup",
    "utmCampaigns": [
      { "campaign": "31marstockup", "orderCount": 6, "revenue": 10880.00, "avgOrderValue": 1813.33 },
      { "campaign": "31marstockup_vm", "orderCount": 5, "revenue": 8422.00, "avgOrderValue": 1684.40 }
    ],
    "orders": [
      { "orderName": "#28556", "totalPrice": 1650.00, "currency": "ZAR", "utmCampaign": "31marstockup_vm", ... }
    ]
  }
}
The utmCampaigns array breaks down revenue per UTM variant, so you can see exactly how much came from the main link vs the “View More” button (_vm suffix). Each order also includes its own utmCampaign field.
Revenue attribution also matches UTM campaign suffix variants: _viewmore, _view_more, and _vm (case-insensitive). This captures orders from “View More” button clicks on the same campaign.

Overall Broadcast Analytics

Pass start_date and end_date to get aggregated analytics across all broadcasts in the date range.
curl "https://api.flowiq.live/broadcast-analytics?start_date=2026-03-01&end_date=2026-03-31" \
  -H "Authorization: Bearer fiq_YOUR_API_KEY"

Response Fields

FieldDescription
overallStatsAggregated totals: sent, delivered, read, failed, rates, campaign count
campaignPerformancePer-campaign breakdown with delivery stats
timeSeriesDataDaily breakdown of sent/delivered/read/failed
templateAnalyticsPer-template aggregated stats and usage counts
errorAnalysisRanked error codes with counts and percentages

POST Method

The same analytics are also available via POST, with parameters in the request body instead of query string:
curl -X POST "https://api.flowiq.live/broadcast-analytics" \
  -H "Authorization: Bearer fiq_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "broadcast_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }'
curl -X POST "https://api.flowiq.live/broadcast-analytics" \
  -H "Authorization: Bearer fiq_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "start_date": "2026-03-01", "end_date": "2026-03-31" }'

Integration Example

async function getBroadcastAnalytics(apiKey, broadcastId) {
  const response = await fetch(
    `https://api.flowiq.live/broadcast-analytics?broadcast_id=${broadcastId}`,
    {
      headers: {
        Authorization: `Bearer ${apiKey}`,
      },
    }
  );
  const data = await response.json();
  if (!response.ok) throw new Error(data.message || data.error);
  return data;
}

const result = await getBroadcastAnalytics(
  "fiq_YOUR_API_KEY",
  "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
);

console.log(`Delivered: ${result.data.deliveryStats.delivered}`);
console.log(`Revenue: ${result.data.revenue.totalRevenue}`);
console.log(`Buttons: ${result.data.allButtons.length} tracked`);

Revenue Attribution

Revenue attribution requires your broadcast template to use a FlowIQ shortcode link (via URL redirects) with a utm_campaign parameter, and your Shopify store to be connected. Orders are matched where utm_source=whatsapp in the landing site URL.

Authorizations

Authorization
string
header
required

Bearer token for authentication. Format: Bearer fiq_YOUR_API_KEY

Query Parameters

broadcast_id
string<uuid>

UUID of a specific broadcast to get detailed analytics for. If provided, start_date and end_date are ignored.

start_date
string<date>

Start date for overall analytics (inclusive). Required when broadcast_id is not provided.

end_date
string<date>

End date for overall analytics (inclusive). Required when broadcast_id is not provided.

Response

Analytics data returned successfully

success
boolean
Example:

true

data
object

Analytics data. Structure varies by mode (individual vs overall).