Service: Plausible Analytics - EyevinnOSC/community GitHub Wiki

Plausible Analytics

Plausible Analytics (serviceId plausible-analytics) is a lightweight, cookie-free, privacy-focused alternative to Google Analytics. In Eyevinn Open Source Cloud (OSC) it is a long-running service instance with up to 10 GiB of storage per instance. License: AGPL-3.0.

What it can do

  • Single-page dashboard with pageviews, referrers and goals, without collecting personal data and without cookies.
  • Track any website by adding a small script tag to its pages.
  • Store site configuration, goals and user accounts in PostgreSQL and all pageview and event data in ClickHouse.

Creating an instance

Plausible needs two databases. Create both first and confirm they are running:

  • PostgreSQL (birme-osc-postgresql) for site configuration, goals and user accounts.
  • ClickHouse (clickhouse-clickhouse) for pageview and event data. Create it with a database and user, for example Db and User set to plausible and a Password.

Read each database's IP and port with describe-service-instance, build the connection URLs, and store them with create-service-secret (serviceId plausible-analytics), for example pgurl and churl. Then create the instance with create-service-instance using serviceId: "plausible-analytics". The name must be alphanumeric and at most 20 characters.

{
  "name": "myplausible",
  "PostgreSQLUrl": "{{secrets.pgurl}}",
  "ClickHouseDbUrl": "{{secrets.churl}}"
}

Wait with wait-for-service-ready, then use describe-service-instance for the instance URL.

Options

Option Required Type Meaning
name Yes string Name of the instance. Letters, digits and underscore only, at most 20 characters.
PostgreSQLUrl Yes string, sensitive PostgreSQL connection URL for site configuration, goals and user accounts. Examples used in OSC tutorials: postgres://postgres:<password>@<IP>:<PORT>/postgres or postgresql://postgres:<password>@<IP>:<PORT>/postgres.
ClickHouseDbUrl Yes string, sensitive ClickHouse connection URL for pageview and event data. Examples used in OSC tutorials: clickhouse://<user>:<password>@<IP>:<PORT> or http://<user>:<password>@<IP>:<PORT>/<database>.

Both options are sensitive: store them as service secrets and reference them as {{secrets.NAME}}, which only works as the entire field value.

Using the instance

Plausible has no default admin account. The first time you open the instance URL, register an account with name, email and password. Then add a website: enter the domain without http:// or https://, and paste the tracking script into the <head> of your pages. Traffic appears in the dashboard shortly after the first page visit.

<script defer data-domain="example.com" src="https://<your-instance-url>/js/script.js"></script>

OSC CLI form:

osc create plausible-analytics myplausible \
  -o PostgreSQLUrl="{{secrets.pgurl}}" \
  -o ClickHouseDbUrl="{{secrets.churl}}"

Limitations

  • Storage is limited to 10 GiB per instance.

Resources

⚠️ **GitHub.com Fallback** ⚠️