SkyDocs
⌘K
Open app
DocsCampaigns

Track revenue per reel, video, or post

Every piece of content you publish through Sky's Content Director gets a unique shortlink. When a viewer clicks it and later pays you on Stripe, the dollar lands on the exact reel, video, or post that produced it.

The short version

When you add a piece to your pipeline (from the Generator's "Add to pipeline" button or as a manual entry), Sky auto-mints a shortlink that looks like this:

https://meetsky.ai/r/k7m2qx9

Paste that link in your IG bio, your YouTube video description, your TikTok comment, anywhere. Sky tracks every click, drops a cookie on the visitor, and forwards them to your destination URL with UTM params attached. When that visitor later pays you on Stripe, the click + the payment get stitched back together — and the dollar shows up next to the reel that earned it.

Different from /docs/campaigns. That doc covers campaign-level UTMs you build by hand. This doc covers piece-level shortlinks Sky mints automatically — one per reel, one per video.

How a click becomes a dollar

The full chain has five steps. Steps 1, 2, and 5 are 100% automatic. Steps 3 and 4 require a one-time setup on your Stripe account (covered below).

  1. You publish a reel with the shortlink in the caption. The pipeline drawer's Production tab has a one-click copy button.
  2. A viewer clicks. Sky's redirect handler logs the click (UA, country, referrer, hashed IP), drops a sky_cd_click cookie, and forwards the visitor to your destination URL with UTM params suffixed.
  3. The visitor checks out on your Stripe. Your landing page reads the sky_cd_click cookie value and passes it as metadata.sky_click_id on the Stripe checkout session.
  4. Stripe webhook fires. Sky receives the event at /edge/cd/webhooks/stripe, verifies the signature, finds the click_id in the event metadata, and looks up which content piece it belongs to.
  5. The dollar is attributed. Sky writes a row to cd_revenue_attribution, a database trigger rolls it up to cd_piece_metrics.cash_attributed_cents, and the Performance tab's "Cash" column updates within seconds.

Wiring your payment processor

Sky supports Whop, Fanbasis, and Stripe out of the box. Configure whichever your audience actually pays through. All three can coexist on a single workspace and attribution resolves correctly because the click_id is the universal join key — not the processor.

The one rule, regardless of processor

On your landing page (the page your shortlink redirects to), read the sky_cd_click cookie and forward its value as sky_click_id into the checkout flow. Without this, the payment can't be attributed.

// On your landing page — read the cookie that /r/[slug] dropped:
const clickId = document.cookie
  .split("; ")
  .find((c) => c.startsWith("sky_cd_click="))
  ?.split("=")[1];

Whop

Whop forwards arbitrary query params into the webhook payload's metadata field. Just append sky_click_id to your Whop checkout URL:

const whopUrl = `https://whop.com/checkout/PRODUCT${
  clickId ? `?sky_click_id=${clickId}` : ""
}`;

Sky's webhook handler is at /edge/integrations/whop/webhooks, configured via Settings → Integrations → Whop. The per-client signing secret lives in client_integrations.config.webhook_secret.

Fanbasis

Same shape — append the click_id to your Fanbasis checkout URL:

const fanbasisUrl = `https://fanbasis.com/checkout/PRODUCT?sky_click_id=${clickId}`;

Webhook lives at /edge/integrations/fanbasis/webhook, wired through the same Settings → Integrations flow.

Stripe

Pass sky_click_id as Stripe checkout metadata server-side:

// Server-side when creating a checkout session:
const session = await stripe.checkout.sessions.create({
  mode: "subscription",
  line_items: [{ price: priceId, quantity: 1 }],
  metadata: clickId ? { sky_click_id: clickId } : undefined,
});

Configure a webhook in your Stripe dashboard pointing at https://meetsky.ai/edge/cd/webhooks/stripe, subscribe to checkout.session.completed, payment_intent.succeeded, charge.succeeded, invoice.payment_succeeded, and charge.refunded. Copy the signing secret to Vercel env as CD_STRIPE_WEBHOOK_SECRET.

Stripe Payment Links work too. Append ?sky_click_id=… to the Payment Link URL — Stripe stores it on the session metadata automatically.

Reading the numbers

Once a payment lands, the data flows into three places:

  • The Performance tab — the "Cash" column on the leaderboard table. Sortable, filterable by platform, range, pillar, and cash bracket.
  • The piece drawer's Performance subtab — full breakdown: views, reach, clicks, CTR, watch %, followers gained, comments, leads, opt-ins, total cash.
  • The drawer's Production tab — the Shortlink widget shows running click count + last-clicked timestamp.

Numbers update within seconds of the Stripe webhook firing — there's no nightly batch.

Edge cases

The same visitor clicks twice

Sky reuses the click_id from the cookie if it's still valid (30-day TTL). Both click events log to cd_link_clicks for analytics, but attribution is to the most recent click before the payment.

The visitor clicks one reel and pays after seeing another

Last-click attribution wins. Whichever shortlink they clicked most recently before checking out is the piece that earns the dollar.

Refunds

On charge.refunded, Sky writes a negative row to cd_revenue_attribution and the rollup trigger subtracts the amount from cash_attributed_cents. Your Performance numbers stay accurate.

Visitor blocked the cookie

If the sky_cd_click cookie isn't set (private browsing, cookie banner declined), the click is still logged but the resulting payment can't be matched. The dollar lands in your Stripe but doesn't attribute to a specific piece. Sky shows it as "unattributed" revenue.

Multi-tenant safety

Click-id matching is global — but the agency_id, client_id, and piece_id are derived from the click row, never from the webhook payload. A malicious actor sending forged click_ids can't cross-attribute revenue between workspaces.