n8n + Plausible Integration: 5 Powerful Workflows You Can Build Today
Connecting your analytics data to the rest of your tools is essential for making smart, timely decisions. This guide will show you how to build a robust n8n Plausible integration to put your website analytics on autopilot. Plausible Analytics is a fantastic privacy-focused alternative to Google Analytics, and when combined with the power of n8n, it becomes an even more potent tool for understanding your audience and performance.
We'll walk through the entire process, from connecting to the Plausible API to building five practical workflows that you can set up today. By the end, you'll be able to automatically generate reports, receive critical alerts, and sync your analytics data across your entire software stack.
Why Automate Plausible Analytics with n8n?
While Plausible provides a clean and beautiful dashboard, its real power is unlocked when you use its API to connect with other services. Manually checking your stats, copying data, and creating reports is time-consuming and prone to error. An n8n Plausible integration automates these repetitive tasks, freeing you to focus on strategy.
Key benefits include:
- Real-time Notifications: Get instantly alerted in Slack, Discord, or via email when your site hits a traffic milestone, experiences a sudden drop, or gets a mention from a major referral source.
- Custom Reporting: Go beyond the standard dashboard. Automatically aggregate key metrics into a Google Sheet, create custom visualizations, or send tailored PDF reports to stakeholders on a schedule. li>Data Enrichment: Combine Plausible data with information from your other tools. For example, you can cross-reference website visitors with customer data from your CRM to understand user journeys better.
- Goal & Event Tracking: Programmatically push custom events to Plausible when actions happen in other apps, such as a user subscribing to a newsletter in ConvertKit or a new sale in Stripe.
Running these automated workflows on a reliable platform is key. A managed service like n8nautomation.cloud ensures your analytics automations run 24/7 without you ever having to worry about server uptime, maintenance, or scaling, which is crucial for time-sensitive alerts.
Setting Up Your n8n + Plausible Integration
Plausible doesn't have a dedicated n8n node yet, but connecting to it is incredibly simple using n8n's universal HTTP Request node. All you need is your site ID and an API key.
- Find Your Plausible API Key:
- Log in to your Plausible account.
- Click on your avatar in the top right corner and go to "Your Settings".
- Scroll down to the "API Keys" section. Click "+ New API Key", give it a descriptive name (e.g., "n8n Integration"), and copy the generated key.
- Find Your Site ID:
- Go to your website's dashboard in Plausible.
- The Site ID is the domain name (e.g.,
yourdomain.com). You'll use this in your API calls.
- Configure the n8n HTTP Request Node:
In any n8n workflow, add an HTTP Request node. This will be the core of your n8n Plausible integration.
- Method:
GET - URL:
https://plausible.io/api/v1/stats/realtime/visitors - Authentication:
Header Auth - Under "Name", enter
Authorization. - Under "Value", enter
Bearer YOUR_API_KEY, replacingYOUR_API_KEYwith the key you copied. It's best practice to store this key in your n8n credentials. - Finally, go to the Query Parameters section. You need to add one parameter:
- Name:
site_id - Value: Your site's domain (e.g.,
yourdomain.com)
- Name:
- Method:
When you execute this node, it should return the number of real-time visitors on your site. Now you're ready to build workflows!
Workflow 1: Get Daily Website Stats in Slack
This simple workflow provides a daily summary of your site's performance directly in a Slack channel, keeping your team informed without needing to log into Plausible.
Nodes Required:
- Schedule Trigger: Triggers the workflow to run at a specific time.
- HTTP Request: Fetches stats from the Plausible API.
- Slack: Formats and sends the message.
- Configure the Schedule Trigger Node:
- Set Trigger Interval to "Daily".
- Choose a time, for example,
9:00AM in your timezone.
- Configure the HTTP Request Node:
- Set up authentication as described in the previous section.
- Change the URL to
https://plausible.io/api/v1/stats/aggregate. - Under Query Parameters, add:
site_id:yourdomain.comperiod:daymetrics:visitors,pageviews,bounce_rate,visit_duration
- Configure the Slack Node:
- Authenticate your Slack account.
- Choose a channel to post the message to (e.g.,
#analytics). - In the Text field, craft your message using expressions to pull in the data from the HTTP Request node. For example:
āļø Good Morning! Here are today's stats for yourdomain.com: Visitors: {{$json["results"]["visitors"]["value"]}} Pageviews: {{$json["results"]["pageviews"]["value"]}} Bounce Rate: {{$json["results"]["bounce_rate"]["value"]}}% Avg Visit Duration: {{$json["results"]["visit_duration"]["value"]}}s
Activate the workflow, and you'll get a clean, automated report in Slack every single day.
Tip: You can create multiple HTTP Request nodes to pull different time periods (e.g., `day`, `7d`, `30d`) and combine them into a single, comprehensive Slack message for a "week-over-week" performance summary.
Workflow 2: Alert on Significant Traffic Spikes
Ever gone viral and not known it for hours? This workflow checks your real-time visitor count every few minutes and sends an alert if it crosses a certain threshold, letting you know instantly when something big is happening.
Nodes Required:
- Schedule Trigger: Runs the workflow on a short interval.
- HTTP Request: Gets the real-time visitor count.
- IF: Checks if the visitor count exceeds your threshold.
- Telegram / Email / Slack: Sends the alert.
- Configure the Schedule Trigger Node:
- Set Trigger Interval to "Minutes".
- Set the interval to
5or10minutes.
- Configure the HTTP Request Node:
- Set the URL to
https://plausible.io/api/v1/stats/realtime/visitors. - Add the
site_idparameter as before.
- Set the URL to
- Configure the IF Node:
- Click Add Condition and select "Number".
- In the first Value field, use an expression to get the visitor count from the previous node:
{{$json["number"]}}. - Set the Operation to "Larger Than".
- In the second Value field, enter your threshold, for example,
100.
- Configure the Notification Node (e.g., Telegram):
- Connect this node to the true output of the IF node.
- Authenticate your Telegram bot and set a Chat ID.
- In the Text field, write your alert message: `š Traffic Spike Alert! There are currently {{$json["number"]}} visitors on the site!`
This workflow is a simple and effective early-warning system. For a platform that needs to react quickly to traffic, running this on a dedicated, always-on instance from n8nautomation.cloud is ideal.
Workflow 3: Create Custom Weekly Reports in Google Sheets
This workflow collects key metrics every week and appends them to a Google Sheet, creating a historical record of your performance that's easy to analyze and visualize.
Nodes Required:
- Schedule Trigger: Runs once a week.
- HTTP Request: Fetches analytics for the last 7 days.
- Google Sheets: Appends data to a sheet.
- Set up your Google Sheet: Create a new sheet with headers like `Date`, `Visitors`, `Pageviews`, `Sources`, and `Bounce Rate`.
- Configure the Schedule Trigger Node: Set it to run "Weekly" on your preferred day, like Monday morning.
- Configure the HTTP Request Node:
- Set the URL to
https://plausible.io/api/v1/stats/aggregate. - Under Query Parameters, add:
site_id:yourdomain.comperiod:7dmetrics:visitors,pageviews,bounce_rate
- Set the URL to
- Configure the Google Sheets Node:
- Authenticate your Google account.
- Set the Operation to "Append".
- Select the Spreadsheet and Sheet by name.
- Under Columns, map the headers in your sheet to the data from the HTTP Request node. For example:
- `Date`:
{{new Date().toISOString().split('T')[0]}}(to get today's date) - `Visitors`:
{{$json["results"]["visitors"]["value"]}} - `Pageviews`:
{{$json["results"]["pageviews"]["value"]}} - `Bounce Rate`:
{{$json["results"]["bounce_rate"]["value"]}}
- `Date`:
Over time, this sheet becomes a valuable dataset for tracking long-term trends.
Workflow 4: Log Marketing Events from Webhooks
You can use the Plausible Events API to track custom goals. This workflow uses a webhook to listen for an external event (like a new newsletter subscriber) and log it in Plausible as a custom `signup` event.
Nodes Required:
- Webhook: The entry point that receives data from your other service (e.g., your email marketing platform).
- HTTP Request: Sends the custom event to Plausible.
- Configure the Webhook Node:
- This node gives you a unique URL. Copy it.
- In your other tool (e.g., ConvertKit, Memberstack), set up an outgoing webhook to send data to this URL whenever a new subscriber is confirmed.
- Run a test to capture the incoming data structure.
- Configure the HTTP Request Node:
- Method:
POST - URL:
https://plausible.io/api/v1/events - Enable JSON/Raw Parameters.
- In the Body Parameters section, add the following:
name:signup(or another goal name)domain:yourdomain.comurl:{{$json.body.page_url}}(assuming the webhook sends the page URL where the signup happened)
- Crucially, you must also pass the user's IP Address and User-Agent in the headers for the event to be processed correctly by Plausible. Set the headers:
X-Forwarded-For:{{$json.headers["x-forwarded-for"]}}User-Agent:{{$json.headers["user-agent"]}}
- Method:
Now, every time your webhook fires, a custom goal will be registered in your Plausible dashboard, giving you a clear view of your conversion funnels.
Workflow 5: Sync Top Pages to a Notion Database
Want to keep your content or product team updated on top-performing pages? This workflow fetches the most visited pages for the week and syncs them into a Notion database.
Nodes Required:
- Schedule Trigger: Runs the workflow weekly.
- HTTP Request: Gets top pages from Plausible.
- Split in Batches: Loops through each page from the API result.
- Notion: Creates or updates an item in a Notion database.
- Set up Notion: Create a database with properties for `Page Path`, `Visitors`, and `Last Updated`.
- Configure the Schedule Trigger Node: Set it to run weekly.
- Configure the HTTP Request Node:
- Set the URL to
https://plausible.io/api/v1/stats/breakdown. - Under Query Parameters, add:
site_id:yourdomain.comperiod:7dproperty:event:pagelimit:20
- Set the URL to
- Configure Split in Batches Node:
- Leave Batch Size as
1. - In the Field to Split, target the results array from the previous node:
{{$json.results}}
- Leave Batch Size as
- Configure the Notion Node:
- Connect this node after the Split in Batches node.
- Authenticate your Notion account and select your database.
- Set the Operation to "Create".
- Map the Notion properties to the data from the Split in batches node:
- `Page Path`:
{{$json.page}} - `Visitors`:
{{$json.visitors}} - `Last Updated`:
{{new Date().toISOString()}}
- `Page Path`:
This creates a dynamic "Top Pages" dashboard right inside Notion, making analytics data accessible to non-technical team members.