Plausible icon

Plausible

Interact with the Plausible API

Overview

The Plausible (Stats: Breakdown) node retrieves a breakdown of website analytics from the Plausible API, grouped by a specified property (such as event name, page path, device type, country, etc.). This is useful for analyzing how different segments of your traffic or events perform over time. For example, you can use this node to see which pages are most visited, what devices visitors use, or where your users come from.

Common scenarios:

  • Marketing teams segmenting traffic sources or campaigns.
  • Product managers analyzing user behavior by device or browser.
  • Content creators tracking which articles or landing pages drive the most engagement.

Practical examples:

  • Get a breakdown of pageviews by country for the last 30 days.
  • Analyze bounce rates per landing page.
  • See which browsers are most popular among your visitors.

Properties

Name Type Meaning
Site ID String Domain of your site in Plausible (e.g., "n8n.io"). Required to specify which site's stats to retrieve.
Property Options The property to break down stats by (e.g., event name, page, device, country, etc.).
Additional Fields Collection Optional fields to refine the query:
└ Period Options Time period for the stats (e.g., day, 7d, 30d, month, custom).
└ Date String Used with "Custom" period; two ISO-8601 dates joined by a comma (e.g., "2023-01-01,2023-02-01").
└ Metrics MultiOptions List of metrics to aggregate (e.g., bounce rate, events, pageviews, visitors, visits, visit duration).
└ Filters String Filter expression to narrow down results (see Plausible filter docs).
└ Limit String Maximum number of results to return (default: 100, max: 1000).
└ Page String Page number for pagination (starts at 1).

Output

The node outputs a JSON object containing the breakdown data returned by the Plausible API. The structure typically includes:

{
  "results": [
    {
      "property": "value",
      "visitors": 123,
      "pageviews": 456,
      // ...other selected metrics
    },
    // ...
  ],
  "page": 1,
  "limit": 100,
  "total_results": 200
}
  • results: Array of objects, each representing a group (e.g., a country, device, or page) and its associated metrics.
  • Each result contains the chosen property and the requested metrics (e.g., visitors, pageviews).
  • Pagination info (page, limit, total_results) may be included if applicable.

Note: The exact fields depend on the selected metrics and property.

Dependencies

  • External Service: Requires access to the Plausible Analytics API.
  • API Key: You must provide valid Plausible API credentials via n8n's credential system (plausibleApi).
  • n8n Configuration: The base URL is derived from your Plausible domain in credentials. Optionally, self-signed SSL certificates can be allowed.

Troubleshooting

Common issues:

  • Invalid credentials: If the API key or domain is incorrect, authentication will fail.
  • Incorrect Site ID: Using a non-existent or misspelled site domain will result in no data or errors.
  • Invalid date format: When using a custom period, ensure the date string is two ISO-8601 dates separated by a comma.
  • Exceeding limits: Setting "Limit" above 1000 will likely cause an error.
  • Filter syntax errors: Malformed filter expressions will be rejected by the API.

Error messages and resolutions:

  • "401 Unauthorized": Check your API key and domain in credentials.
  • "400 Bad Request": Review your input parameters, especially date formats and filters.
  • "404 Not Found": Ensure the Site ID matches a site in your Plausible account.

Links and References

Discussion