Docs / Features / Pageview Tracking

Pageview Tracking

Transparent usage metering and lightweight traffic analytics — see how many people visit pages with your widget, without needing a separate analytics tool.

How pageviews are counted

Plan limits

Dashboard

Visit Traffic in your dashboard for usage meters, visitor counts, top pages, and referrer breakdowns. Warnings appear at 80% usage; new comments are blocked at 100% until you upgrade.

API

POST /v1/pageview
{
  "site_id": "uuid",
  "url": "https://yoursite.com/article",
  "session_id": "browser-session-id",
  "referrer": "https://google.com"
}

Usage alerts

Pageview webhooks do not exist today. Usage alerts are dashboard- and API-driven, not outbound webhook events.

POST /v1/pageview  ->  200
{
  "ok": true,
  "counted": true,
  "usage": {
    "used": 8200,
    "limit": 10000,
    "percent": 82,
    "status": "warning"
  }
}

To build your own alert webhook: poll site usage (or watch pageview responses) and POST to your endpoint when percent >= 80. Publisher webhooks today fire for comment.created; pageview alerts are usage-based, not webhook events yet.

Example Node receiver that emails or Slack-notifies at 80%+:

// Your cron or worker polls Threadline, then POSTs here
import express from 'express';

const app = express();
app.use(express.json());

app.post('/hooks/threadline-usage', async (req, res) => {
  const { site_id, usage } = req.body; // { used, limit, percent, status }
  if (!usage || usage.percent < 80) return res.status(200).json({ ok: true, skipped: true });

  const text = `[Threadline] Site ${site_id} at ${usage.percent}% (${usage.used}/${usage.limit}) - ${usage.status}`;

  // Slack
  await fetch(process.env.SLACK_WEBHOOK_URL, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ text }),
  });

  // Or email via your provider
  // await sendEmail({ to: 'ops@you.com', subject: 'Usage alert', body: text });

  res.json({ ok: true });
});

app.listen(3001);