---
title: "Deploy Plausible Shopify"
description: "Cookie-free Shopify stats and checkout goals"
category: "Analytics"
url: https://railway.com/deploy/deploy-plausible-for-shopify-stores
---

# Deploy Plausible Shopify

Cookie-free Shopify stats and checkout goals

**[Deploy Plausible Shopify on Railway](https://railway.com/template/deploy-plausible-for-shopify-stores)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/deploy-plausible-for-shopify-stores/manifest.json

- **Creator:** onepush
- **Category:** Analytics

## Template content

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### ClickHouse

- **Image:** clickhouse/clickhouse-server:24.12-alpine

### plausible

- **Image:** ghcr.io/plausible/community-edition:v3.2.1
- **Start command:** `sh -c "/entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run"`
- **Health check:** /api/health
- **Public domain:** Yes

## Documentation

# Deploy and Host self hosted Plausible Shopify (Cookie-Free Shopify Store Analytics) on Railway

Plausible Shopify runs Plausible Community Edition v3.2.1 on Railway, with Postgres for accounts and sites and ClickHouse for events.

## About Hosting Plausible Shopify open-source software on Railway (self hosted Plausible analytics for Shopify stores template)

Running Plausible on your own Railway project means the event data for your store stays on infrastructure you control, not inside a third-party analytics vendor's dashboard.

## Why Deploy Plausible Shopify, the Google Analytics 4 alternative on Railway (Railway Free Trial)

GA4 is free but sets cookies, often needs an EU consent banner, and keeps funnel data on Google's servers.

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Plausible Shopify on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

### Railway vs Other Hosting Providers and VPS for Plausible Shopify self hosting

Plausible CE needs Postgres, ClickHouse and an Elixir app, and each host trades setup effort against control.

| Provider | What You Get with Railway | What You Get with the Other Provider |
|---|---|---|
| DigitalOcean | Three linked services and HTTPS on a public domain, with no reverse proxy to set up. | A Droplet with root access and a flat price, but compose and certificates are yours to manage. |
| AWS | One template with no IAM roles, subnets or security groups to configure first. | Wide region choice and fine networking control, with a larger setup surface. |
| Hetzner | Managed container deploys and public domains, with no OS patching on your side. | Low VPS prices and generous RAM, which helps because ClickHouse is the biggest memory user. |

Choose Railway for a quick start, and a VPS when you want to tune ClickHouse memory by hand.

## Common Use Cases for hosted Plausible Shopify

- **Storefront traffic without a cookie banner:** Plausible sets no cookies and stores no personal identifiers, so you can count visitors, top pages and referrers without a consent banner.
- **Checkout funnel step counts via custom pixel events:** The theme snippet skips checkout pages, so a Shopify custom pixel under Settings, Customer events sends checkout_started, payment_info_submitted and checkout_completed to Plausible.
- **Add-to-cart goals with product properties:** Subscribe the pixel to product_added_to_cart and attach productTitle and quantity to see which products get added most often.
- **Campaign and referrer attribution to purchases:** Tag ad and email links with UTM parameters and compare Purchase goal conversions per source, though CE will not show revenue for each one.
- **Site search tracking:** Send Shopify search queries as a Search event with a searchQuery property to see which terms shoppers type and whether they lead to an add-to-cart.

## Dependencies for Plausible Shopify Docker hosted on Railway

This template runs three services: the Plausible Community Edition app, a Railway Postgres database for users, sites, and goals, and a ClickHouse server that stores every storefront event.

### Deployment Dependencies for Managed Plausible Shopify Service (Web Analytics)

The plausible service runs ghcr.io/plausible/community-edition:v3.2.1, an Elixir and Phoenix app on port 8000 with a public HTTPS domain and a volume at /var/lib/plausible.

### Implementation Details for Plausible Shopify (Using Plausible official docker image)

BASE_URL is https://${{RAILWAY_PUBLIC_DOMAIN}} and SECRET_KEY_BASE is ${{secret(64)}}, which must stay stable.

## How does Plausible Shopify compare against other analytics options for Shopify

### Plausible vs Google Analytics 4 (Google Analytics 4 Alternative)

- **Privacy and consent:** Plausible sets no cookies and collects no personal data, so most Shopify stores can skip a cookie banner. GA4 uses cookies and usually needs one for EU visitors.
- **Script weight:** Plausible's script is far smaller than GA4's, which matters on a storefront already heavy with theme assets.
- **Where GA4 wins:** GA4 is free, hosted by Google, and connects natively to Shopify and Google Ads with deep attribution tools.

### Plausible vs Shopify Analytics (Shopify Analytics Alternative)

- **Scope:** Shopify Analytics sits in the Shopify admin and reports on sales, orders and customers. Plausible reports on visits, pages, referrers and the funnel steps you define.
- **Checkout tracking:** Shopify covers checkout natively. Plausible needs a custom pixel to see checkout and thank-you steps.
- **Where Shopify wins:** Revenue sits next to the store with no extra setup, and Plausible CE does not show revenue at all.

### Plausible vs Fathom (Fathom Analytics Alternative)

- **Hosting model:** Fathom is closed-source SaaS with no self-hosted option. Plausible CE runs on your own server under AGPL-3.0.
- **Privacy:** Both are cookie-free, so the consent story is similar.
- **Where Fathom wins:** It is fully managed with no infrastructure to run and a polished interface.

### Plausible vs Matomo (Matomo Alternative)

- **Footprint:** Matomo is PHP on MySQL or MariaDB with a broad feature set. Plausible CE is Elixir on Postgres and ClickHouse with a narrower one-page dashboard.
- **Ecommerce reporting:** Matomo offers ecommerce reports in its core product. Plausible CE leaves revenue goals out, so you read conversion counts instead.
- **Where Matomo wins:** It covers far more reports if you need a full analytics suite rather than a lightweight traffic and funnel view.

## How to use Plausible Shopify (the OSS web analytics platform)?

1. In Plausible, add a website using your store's bare domain, such as example-store.com, with no https:// or path.
2. Copy the site snippet from Site Settings, General, Site Installation.
3. In Shopify admin, open Online Store, Themes, Edit code, Layout, theme.liquid, paste the snippet in the head, and save. Checkout pages skip the theme layout, so they need the pixel below.
4. Go to Settings, Customer events, Add custom pixel, paste this code, save, and click Connect.
5. Create Purchase, Begin Checkout and Add to Cart goals, then place a test order and watch it in Realtime.

```javascript
const DATA_DOMAIN = "example-store.com";
const script = document.createElement("script");
script.defer = true;
script.dataset.domain = DATA_DOMAIN;
script.dataset.api = "https://your-plausible-domain/api/event";
script.src = "https://your-plausible-domain/js/script.js";
document.head.appendChild(script);
window.plausible = window.plausible || function () { (window.plausible.q = window.plausible.q || []).push(arguments); };

analytics.subscribe("checkout_completed", (event) => {
  window.plausible("Purchase");
});
```

## How to self host Plausible Shopify on other VPS Services (Plausible self hosting guide)

### Clone the Repository

Start on a Linux VPS with Docker and the Compose plugin.

```bash
git clone -b v3.2.1 --single-branch https://github.com/plausible/community-edition plausible-ce
cd plausible-ce
```

### Install Dependencies

You do not install Elixir or Postgres by hand, since the compose file pulls the Plausible image, Postgres and ClickHouse.

### Configure Environment Variables

Create a `.env` file with your public URL and a generated secret. The secret must be at least 64 bytes, so keep it stable across restarts.

```bash
# .env
BASE_URL=https://your-domain
SECRET_KEY_BASE=output-of-openssl-rand-base64-48
DISABLE_REGISTRATION=invite_only
```

Point your-domain at the VPS.

### Start the Plausible Shopify Application

Bring the stack up in the background, then open your-domain and register the first account, which becomes the owner.

```bash
docker compose up -d
docker compose logs -f plausible
```

Railway handles the public domain, TLS and volumes for you, while on a VPS you manage all of those yourself.

## Official Pricing of Plausible Shopify (Plausible pricing)

Plausible CE is free and open source under AGPL-3.0, so there is no license fee to self host it.

Plausible Cloud is the paid hosted option. Ecommerce revenue goals are a Cloud feature, so Shopify revenue values need Cloud rather than CE.

## Plausible Shopify cloud vs self hosted comparison (Pricing, features, costs, and more)

Self hosting Plausible on Railway is a different bill than Plausible Cloud, and CE drops ecommerce revenue goals, funnels and user journeys.

### Monthly cost of self hosting Plausible Shopify on Railway

Railway cost depends on traffic and event volume. Back up both Postgres and the ClickHouse volume, since losing either one loses data.

### System Requirements for Hosting Plausible Shopify on a VPS

Your CPU must support SSE 4.2 or NEON because ClickHouse requires it. The CE README recommends at least 2 GB of RAM to avoid out-of-memory crashes.

## Frequently Asked Questions (FAQs)

### Do I need a cookie banner for Plausible on Shopify?

Usually no. Check the rules in your market before removing one.

### Why do checkout pages need a custom pixel?

Checkout pages such as /checkouts/cn/ID/review and the thank-you page skip your theme layout, so the theme.liquid snippet never loads there.

### Does Plausible Community Edition show revenue?

No. Ecommerce revenue goals are a Cloud feature, so CE does not report revenue values.

### Why did my test order not appear?

Confirm the pixel is connected and that the Purchase goal uses the exact event name.

### Does Plausible slow down my store?

No. The script is very small and loads with defer, so it adds little to page weight.

### Can I track add to cart events?

Yes. Then create a matching Add to Cart goal in Plausible.


## Similar templates

- [Plausible WordPress](https://railway.com/deploy/deploy-plausible-for-wordpress-sites) — Cookie-free WordPress stats from your own Plausible
- [Typesense Multilingual](https://railway.com/deploy/deploy-typesense-multilingual-search) — Locale-aware multilingual search with Typesense
- [Formbricks](https://railway.com/deploy/formbricks-surveys) — Surveys, NPS and in-app feedback on your own Postgres, Hub and Cube

Open this page in a browser: https://railway.com/deploy/deploy-plausible-for-shopify-stores
