1. Why raw insights APIs fail in customer dashboards
Calling Meta Graph and TikTok insights endpoints directly on page load exposes your users to multi-second latency and unpredictable 429 throttling. Worse, each platform names engagement fields differently across Reels, Feed posts, and Stories.
PubNio normalizes impressions, reach, likes, comments, shares, saves, and link clicks into one typed shape while preserving per-channel and per-placement attribution.
const analytics = await ws.analytics.getPost(postId);
for (const target of analytics.targets) {
console.log(
target.provider,
target.placement,
target.totals.impressions,
target.totals.engagements,
);
}
2. Attempt-scoped history & scope isolation
Because observations bind to the publish attempt ID, retrying a failed post never mixes metrics across attempts. Optional analytics scopes stay isolated from publishing scopes so a missing insights permission never blocks publishing.