Ecency analytics
Self-host Plausible Community Edition and connect it to an @ecency/web instance for privacy-friendly metrics.
Ecency analytics with Plausible
Ecency uses Plausible Analytics to track privacy-friendly usage metrics without cookies. This guide shows how to run the Plausible Community Edition and connect it to an @ecency/web deployment.
Quickstart: run Plausible CE
Follow these steps on a host with Docker installed:
- Prepare system packages and clone Plausible CE.
Terminal window sudo apt updategit clone -b v2.1.3 --single-branch https://github.com/plausible/community-edition plausible-cecd plausible-ce - Create your environment file. Update the base URL to match the public hostname you will serve Plausible from.
Terminal window touch .envecho "BASE_URL=https://pl.ecency.com" >> .envecho "SECRET_KEY_BASE=$(openssl rand -base64 48)" >> .envecho "HTTP_PORT=80" >> .envecho "HTTPS_PORT=443" >> .env - Expose Plausible ports locally.
Terminal window cat > compose.override.yml << 'YAML'services:plausible:ports:- 80:80- 443:443YAML - Install Docker Compose and launch.
Terminal window sudo apt install docker.iosudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-composesudo chmod +x /usr/local/bin/docker-composedocker-compose --versiondocker-compose up -d
The Plausible UI will now be reachable at the BASE_URL you set (e.g., https://pl.ecency.com). Log in, create your site (domain), and note the script URL from the Settings → Script page.
Connect to @ecency/web
Add the Plausible script to your @ecency/web deployment so page views are sent to your instance:
- Set the Plausible environment variables. In your web environment configuration (e.g.,
.env.local), add:Terminal window PLAUSIBLE_API_HOST=https://pl.ecency.comPLAUSIBLE_DOMAIN=ecency.comPLAUSIBLE_API_KEY=your_plausible_api_key- Replace
pl.ecency.comwith the host where you run Plausible CE. - Set
PLAUSIBLE_DOMAINto the domain you added in Plausible. - Generate the API key from Plausible (Settings → API keys) so the site can send pageview events.
- Replace
- Include the tracking script. Ensure your app template or
_documentinjects Plausible:<scriptdeferdata-domain="${process.env.PLAUSIBLE_DOMAIN}"src="${process.env.PLAUSIBLE_API_HOST}/js/script.js"></script> - Deploy and verify. Redeploy
@ecency/web, browse a few pages, and confirm events appear in the Plausible dashboard under Realtime.
By self-hosting Plausible CE, Ecency analytics stay lightweight, GDPR-friendly, and free from third-party trackers.