Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/data-access.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@ sidebar_label: Accessing your data
description: "Choose the right way to access your Plausible data outside the dashboard: Stats API, Events API, Sites API, CSV export, Data Studio, MCP server or data warehouse connectors."
---

import CtaBox from '@site/src/components/CtaBox';

Plausible gives you several ways to access your stats outside the dashboard. The right option depends on whether you want to query data, send data, manage sites or export for offline use.

<CtaBox
headline="Your stats are not locked inside the dashboard. Try Plausible free for 30 days, no credit card required"
link="https://plausible.io/register"
linkText="Start free trial"
secondaryLink="https://plausible.io/plausible.io"
secondaryText="View live demo"
/>

## Quick reference

| I want to... | Option |
Expand Down
7 changes: 7 additions & 0 deletions docs/events-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@ sidebar_label: Events API reference
description: "Reference for the Plausible Events API. Send pageviews and custom events server-side or from mobile apps without the JavaScript snippet."
---

import CtaBox from '@site/src/components/CtaBox';
import {Required, Optional} from '../src/js/api-helpers.tsx';

The Plausible Events API can be used to record pageviews and custom events. This is useful when tracking Android or iOS mobile apps, or for server side tracking.

In most cases we recommend installing Plausible through our provided [script](/docs/plausible-script) or one of the many
integration packages listed [here](/docs/integration-guides). However, if there's no easy way for you to integrate with Plausible, you can still do so by sending events directly to our API.

<CtaBox
headline="Record pageviews and events from your server or mobile app. Try Plausible free for 30 days, no credit card required"
link="https://plausible.io/register"
linkText="Start free trial"
/>

### Unique visitor tracking

**Important!** Special care should be taken with two key headers which are used for [unique visitor counting](https://plausible.io/data-policy#how-we-count-unique-visitors-without-cookies):
Expand Down
7 changes: 7 additions & 0 deletions docs/export-stats.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: Export your website stats
description: "Export your Plausible stats as CSV files directly from the dashboard. Filter by date range, audience segment or goal, including data imported from other tools."
---

import CtaBox from '@site/src/components/CtaBox';
import useBaseUrl from '@docusaurus/useBaseUrl';

Choose an export method based on what you need:
Expand All @@ -14,6 +15,12 @@ Choose an export method based on what you need:
| [Stats API](#use-the-stats-api) | Querying aggregated stats programmatically for custom reports or integrations. |
| [Scheduled raw event data exports](#scheduled-raw-event-data-exports) | Receiving daily event-level data in your own storage for warehousing or custom analysis. |

<CtaBox
headline="Own your website stats and export them as CSV. Try Plausible free for 30 days, no credit card required"
link="https://plausible.io/register"
linkText="Start free trial"
/>

:::note Exporting after your trial or subscription ends
If you no longer have an active trial or subscription, you can still export your stats from **Site Settings → Imports & exports** before your dashboards and stats are deleted. Dashboard exports and the Stats API are unavailable without an active trial or subscription.

Expand Down
10 changes: 10 additions & 0 deletions docs/mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@ sidebar_label: "AI integration (MCP)"
description: "Connect to Plausible's official read-only MCP server using OAuth, choose your team and ask questions about your stats. Included with every plan."
---

import CtaBox from '@site/src/components/CtaBox';

You can connect your AI assistant (like Claude, ChatGPT, etc.) to Plausible and ask questions about your stats. We use MCP (Model Context Protocol), a standard that lets AI assistants connect to other apps. Our integration is included on all plans, at no extra charge.

<CtaBox
headline="No Plausible account yet? Start a free trial and ask your AI assistant about your stats. No credit card required"
link="https://plausible.io/register"
linkText="Start free trial"
secondaryLink="https://plausible.io/mcp-server"
secondaryText="See what you can ask"
/>

## Before you connect

You’ll need to be a member of the Plausible team whose stats you want to use. Any team role works. If you only have guest access to a site, ask the team owner to add you as a member.
Expand Down
9 changes: 9 additions & 0 deletions docs/metrics-definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,19 @@ title: Metrics definitions
description: "Definitions for every metric in Plausible: unique visitors, sessions, pageviews, bounce rate, visit duration, conversion rate and more. All in one place."
---

import CtaBox from '@site/src/components/CtaBox';
import useBaseUrl from '@docusaurus/useBaseUrl';

These are the metrics you'll find across your Plausible dashboard. They're grouped by category to help you understand how they relate to each other.

<CtaBox
headline="See these metrics on a real dashboard"
link="https://plausible.io/plausible.io"
linkText="View live demo"
secondaryLink="https://plausible.io/register"
secondaryText="Start free trial"
/>

---

## Traffic
Expand Down
7 changes: 7 additions & 0 deletions docs/stats-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description: "Complete reference for the Plausible Stats API v2. Query historica
toc_max_heading_level: 4
---

import CtaBox from '@site/src/components/CtaBox';
import { ApiV2Example, ExamplesTip } from '../src/js/apiv2-example.tsx';
import { Required, Optional } from '../src/js/api-helpers.tsx';
import { getExampleCode, EXAMPLE_RESPONSE_META } from '../src/js/examples.tsx';
Expand All @@ -20,6 +21,12 @@ Take a look at our [Events API Reference](events-api.md) if you want to record p

<PlanFeatureNote feature="stats-api" plan="business" label="Stats API" />

<CtaBox
headline="The Stats API is included in the 30-day free trial. No credit card required"
link="https://plausible.io/register"
linkText="Start free trial"
/>

## Authentication

API keys are scoped to one team. The team selected in the top-right menu when you create the key determines which sites it can query. A key does not inherit access to every site its owner can view across Plausible.
Expand Down
8 changes: 8 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ module.exports = {
scripts: [
{src: '/docs/js/tracking.js', defer: true}
],
// Hide logged-out CTAs before first paint so logged-in visitors never see them flash
headTags: [
{
tagName: 'script',
attributes: {},
innerHTML: "if (document.cookie.includes('logged_in=true')) document.documentElement.classList.add('logged-in')",
},
],
plugins: ['@docsearch/docusaurus-adapter'],
themeConfig: {
docs: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/CtaBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function CtaBox({ headline, link, linkText, secondaryLink, second
if (loggedIn) return null;

return (
<div className="cta-box">
<div className="cta-box logged-out-only">
<p>{headline}</p>
<div className="cta-box-actions">
<a href={link} className="cta-box-primary" style={{color: '#ffffff'}} data-cta-position="Inline" data-cta-platform={platform}>
Expand Down
11 changes: 9 additions & 2 deletions src/components/PlanFeatureNote.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import React from 'react';
import React, { useState, useEffect } from 'react';

export default function PlanFeatureNote({ feature, plan, label }) {
// Logged-in users go straight to the plan picker in their account instead of the public pricing section.
const [loggedIn, setLoggedIn] = useState(false);
useEffect(() => {
setLoggedIn(document.cookie.includes('logged_in=true'));
}, []);

const isBusiness = plan === 'business';
const planLabel = isBusiness ? 'Business' : 'Enterprise';
const article = isBusiness ? 'a' : 'an';
const link = isBusiness ? 'https://plausible.io/#pricing' : 'https://plausible.io/contact';
const pricingLink = loggedIn ? 'https://plausible.io/billing/choose-plan' : 'https://plausible.io/#pricing';
const link = isBusiness ? pricingLink : 'https://plausible.io/contact';
const linkText = isBusiness ? 'Compare plans →' : 'Contact us →';

return (
Expand Down
5 changes: 5 additions & 0 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,11 @@ html[data-theme='dark'] {
grid-column: 1 / -1;
}

/* Set in <head> before first paint, see headTags in docusaurus.config.js */
.logged-in .logged-out-only {
display: none !important;
}

/* Inline CTA box */
.cta-box {
margin: 1.5rem 0;
Expand Down
2 changes: 1 addition & 1 deletion src/theme/Footer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function Footer() {
return (
<>
{!loggedIn && (
<div className={styles.ctaBanner}>
<div className={`${styles.ctaBanner} logged-out-only`}>
<div className={styles.ctaInner}>
<div className={styles.ctaText}>
<h2 className={styles.ctaHeading}>Ready to ditch Google Analytics?</h2>
Expand Down
2 changes: 1 addition & 1 deletion src/theme/NavbarItem/CustomLoginStatusNavbarItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function CustomLoginStatusNavbarItem({ mobile }) {
}

return (
<div className="navbarLoginStatusDesktop" style={{ display: 'flex', alignItems: 'center', gap: '0.75rem', order: 999, marginLeft: '1rem' }}>
<div className="navbarLoginStatusDesktop logged-out-only" style={{ display: 'flex', alignItems: 'center', gap: '0.75rem', order: 999, marginLeft: '1rem' }}>
<a href="https://plausible.io/login" className="navbar__item navbar__link" style={{ fontWeight: 500 }}>
Log in
</a>
Expand Down
1 change: 1 addition & 0 deletions static/js/tracking.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ if (!window.plausibleDocsCtaTracking) {
if (path === '/register') button = 'Start free trial';
else if (path === '/plausible.io') button = 'View live demo';
else if (path === '/' && url.hash === '#pricing') button = 'See pricing';
else if (path === '/billing/choose-plan' && a.hasAttribute('data-cta-position')) button = 'See pricing';
else if (path === '/contact') button = 'Contact us';
else return;
var props = {
Expand Down