Antlytics logoAntlytics

Use Antlytics data in Grafana

Display Antlytics analytics data in Grafana dashboards using the JSON API datasource plugin and the Antlytics REST API.

Prerequisites

  • Grafana 9+ (cloud or self-hosted)
  • The JSON API datasource plugin installed (search "JSON API" in Plugins → Add new plugin)

Setup

Install the JSON API plugin

In Grafana Cloud or self-hosted: Administration → Plugins → search "JSON API" → Install.

Configure the datasource

  1. Go to Connections → Data sources → Add new data source.
  2. Choose JSON API.
  3. Set:
    • URL: https://www.antlytics.com/api/v1
    • Auth → Custom HTTP Headers:
      • Header: Authorization
      • Value: Bearer ant_YOUR_TOKEN
  4. Click Save & test.

Creating panels

Summary stats panel

Add a Stat or Time series panel with this datasource query:

  • Path: /stats
  • Query string: site_id=YOUR_SITE_ID&from=${__from:date:iso}&to=${__to:date:iso}
  • Fields:
    • visitors → Visitors
    • pageviews → Pageviews
    • bounce_rate → Bounce rate (%)

Top pages table

Add a Table panel:

  • Path: /pages
  • Query string: site_id=YOUR_SITE_ID&from=${__from:date:iso}&to=${__to:date:iso}&limit=10
  • Columns: path, pageviews, visitors

Top referrers table

  • Path: /referrers
  • Query string: site_id=YOUR_SITE_ID&from=${__from:date:iso}&to=${__to:date:iso}&limit=10
  • Columns: referrer, visits

Example dashboard JSON

Import this minimal dashboard via Dashboards → Import → Paste JSON:

{
  "title": "Antlytics",
  "panels": [
    {
      "type": "stat",
      "title": "Visitors",
      "datasource": "JSON API",
      "targets": [{ "fields": [{ "jsonPath": "$.visitors" }] }],
      "gridPos": { "x": 0, "y": 0, "w": 4, "h": 4 }
    },
    {
      "type": "stat",
      "title": "Pageviews",
      "datasource": "JSON API",
      "targets": [{ "fields": [{ "jsonPath": "$.pageviews" }] }],
      "gridPos": { "x": 4, "y": 0, "w": 4, "h": 4 }
    }
  ]
}

Adjust datasource to match the name you gave your JSON API source.


Need help?

Email support@antlytics.com with your site ID.

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