Antlytics logoAntlytics

Connect Antlytics to n8n

n8n is an open-source automation platform. Connect it to Antlytics via webhooks or scheduled API calls.

Option A: Webhooks (recommended)

  1. In n8n, create a new workflow. Add a Webhook node as the trigger.
  2. Set the HTTP Method to POST. Copy the Test URL (or Production URL for live use).
  3. In your Antlytics dashboard, go to Settings → WebhooksAdd webhook.
  4. Paste the URL, select your events, then click Create. Save the signing secret.
  5. Click Test in Antlytics to fire a test payload into n8n.
  6. In n8n, activate the webhook and add downstream nodes — e.g. Slack, Notion, Google Sheets.

Example payload (daily summary)

{
  "event": "daily_summary",
  "site_id": "YOUR_SITE_ID",
  "site_name": "example.com",
  "period": "2026-04-11",
  "stats": {
    "visitors": 142,
    "pageviews": 387,
    "bounce_rate": 45,
    "top_pages": [{ "path": "/", "visitors": 80 }],
    "top_referrers": []
  },
  "timestamp": "2026-04-11T09:00:00Z"
}

Access fields in n8n expressions as {{ $json.stats.visitors }}.

Verifying signatures

Add a Code node before your action nodes to verify the X-Antlytics-Signature header:

const crypto = require('crypto');
const secret = 'YOUR_WEBHOOK_SECRET';
const body = JSON.stringify($input.first().json);
const expected = 'sha256=' + crypto.createHmac('sha256', secret).update(body).digest('hex');
if ($input.first().headers['x-antlytics-signature'] !== expected) {
  throw new Error('Invalid signature');
}
return $input.all();

Option B: API polling via Schedule trigger

  1. Add a Schedule Trigger node (e.g. daily at 09:00).
  2. Add an HTTP Request node configured as:
    • Method: GET
    • URL: https://www.antlytics.com/api/v1/stats?site_id=YOUR_SITE_ID
    • Authentication: Header Auth — Authorization: Bearer ant_YOUR_TOKEN
  3. Connect the response to downstream nodes.

Need help?

Email support@antlytics.com with your site ID.

Something missing? Get in touch and we will update these docs.