Loading tutorials…
Loading tutorials…
Plausible has the simplest install of any analytics tool — one script tag. That's also why it's the easiest to install wrong: pick the wrong script variant, miss the data-domain attribute, or install through GTM without unblocking outbound clicks, and half your tracking silently breaks.
Who this is forEngineers, marketers, and founders installing Plausible for the first time. Especially helpful if you're on Next.js App Router, Shopify, or WordPress — each platform has a slightly different best-practice install, and the wrong path is hard to detect.
What you'll need
Step 1
Plausible ships ~8 script variants. Pick the combination you need at install time — switching later is a redeploy, not a config change.
plausible.js — basic pageview tracking. Default. Use this if you do not need anything fancy.
plausible.outbound-links.js — auto-tracks clicks on external links as a "Outbound Link: Click" custom event. Essential for affiliate/marketing sites.
plausible.file-downloads.js — auto-tracks clicks on links to .pdf, .zip, .mp3, .doc, etc. Essential if you publish PDFs or assets.
plausible.tagged-events.js — lets you tag any HTML element with class="plausible-event-name=foo" and it fires as a custom event. Covered in tutorial #3.
plausible.hash.js — for sites that use hash-based routing (older SPAs). Modern Next.js / React / Vue do NOT need this.
plausible.404.js — auto-tracks 404 errors as a custom event. Useful for catching broken links.
plausible.pageview-props.js — lets you send custom props with every pageview (e.g. logged-in vs anonymous). Required for the Custom Properties feature (tutorial #5).
Variants COMBINE in the URL: plausible.outbound-links.file-downloads.tagged-events.js loads all three together. Pick all the variants you need upfront and combine them in one script tag.
Step 2
Paste one line into the <head> of every page. The data-domain attribute MUST match what you registered in Plausible exactly.
Copy the install snippet from Site Settings → Tracking Code. Example: <script defer data-domain="acme.com" src="https://plausible.io/js/script.outbound-links.tagged-events.js"></script>
Paste it inside the <head> tag of every page on your site. The defer attribute is critical — it prevents the script from blocking page render.
data-domain MUST exactly match what you registered. If you registered "acme.com" and your script says data-domain="www.acme.com", events fire to a different (non-existent) site and your dashboard stays empty.
For static HTML sites, paste it into the master template / layout file. For Jekyll / Hugo / 11ty, that is _layouts/default.html or similar.
Deploy. Wait 60 seconds. Visit your site. Check the Plausible dashboard — Realtime panel (top right of the dashboard) should show 1 visitor.
Step 3
Next.js App Router has subtle hydration gotchas. Use the official next/script with strategy='afterInteractive' or the @plausible-analytics/tracker package.
Option A — next/script in app/layout.tsx: import Script from "next/script". Add <Script defer data-domain="acme.com" src="https://plausible.io/js/script.outbound-links.tagged-events.js" strategy="afterInteractive" /> inside the <body>.
Option B — @plausible-analytics/tracker (official package): `npm i @plausible-analytics/tracker`. Then in a Client Component, init Plausible inside a useEffect.
App Router SSR gotcha: do NOT put the Plausible script inside a 'use client' Suspense boundary — it will not run on initial SSR. Place it in the root layout outside any client component.
App Router routing: route changes via <Link> fire pageview events automatically — Plausible's script listens to History API changes. You do NOT need to manually call plausible('pageview') on route change like you would in Next.js Pages Router with @next/script + custom code.
If you have a /preview or /admin section, set data-include or data-exclude attributes on the script tag to scope what gets tracked. Example: <Script ... data-exclude='/admin/*,/preview/*' />.
Step 4
GTM-based install works but has caveats. The Custom HTML tag approach is most common. Use this only if you are already running GTM for other reasons.
In GTM → Tags → New → Custom HTML. Paste: <script defer data-domain="acme.com" src="https://plausible.io/js/script.outbound-links.tagged-events.js"></script>
Trigger: All Pages. Save and Publish.
WARNING: outbound-link tracking from the Plausible script may not work via GTM because GTM injects the script after page load — outbound clicks happen on user interaction, which races with script load. Test extensively before relying on it.
Better path if you are committed to GTM: use the Custom HTML tag for the BASIC script (no outbound-links variant). Then create separate GTM triggers for outbound clicks + downloads + custom events, each firing a plausible() call manually.
Honestly: if Plausible is your ONLY tracking tool, install it directly (skip GTM). If you have multiple tracking tools (Plausible + Meta Pixel + LinkedIn), GTM is the right home — but use it carefully.
Step 5
Shopify has no native Plausible integration. Paste the snippet into theme.liquid in the <head>. Customer Events sandbox is the modern alternative.
Online Store → Themes → Actions → Edit code. Open layout/theme.liquid.
Find the closing </head> tag. Paste the Plausible snippet directly before it: <script defer data-domain="yourstore.com" src="https://plausible.io/js/script.outbound-links.tagged-events.js"></script>
Save. Visit your storefront in incognito (no extensions). Check Plausible Realtime — should tick to 1.
For checkout-page tracking: theme.liquid only covers storefront. Checkout pages run in a separate sandboxed environment. Go to Settings → Customer Events → Add custom pixel. Paste a JavaScript-mode pixel that calls window.plausible("checkout_completed") on the appropriate event.
For ecommerce purchase tracking specifically: on the order confirmation page (typically order-status.liquid or via Customer Events), fire window.plausible("Purchase", {props: {revenue: {{order.total_price | money_without_currency}}, currency: "{{shop.currency}}"}}). Covered in tutorial #3.
Step 6
Plausible has an official WordPress plugin — use it. Manual snippet install works too but the plugin handles updates and integrates with WordPress-specific events.
WordPress admin → Plugins → Add New → search "Plausible Analytics". Install the official plugin by Plausible team. Activate.
Settings → Plausible Analytics. Connect your Plausible account (paste API token from plausible.io → Account → API Tokens).
Enable the extensions you want: Outbound link tracking, File download tracking, 404 error tracking, Form submissions. Each adds the corresponding script variant automatically.
For manual install (no plugin), paste the snippet into your theme's header.php inside <?php wp_head(); ?> region. Use a child theme so the snippet survives parent-theme updates.
Avoid double-install: if you previously had a 'GA4 + plausible' setup via a multi-tool plugin like MonsterInsights or Site Kit, disable the Plausible portion there before activating the official plugin. Double-installs fire 2x pageviews.
Step 7
Visit at least 5 different page templates (home, product, blog, contact, checkout). Confirm each fires a pageview in Realtime and check DevTools → Network for the script + event request.
Open Plausible → click your site → look at the Realtime visitors counter (top right of the dashboard).
In a separate incognito browser (no ad blockers, no plausible_ignore flag), visit your homepage. Realtime should tick up by 1 within 30 seconds.
Navigate to 4-5 different page templates: a blog post, a product page, a contact page, a 404 page, a thank-you page. Each should fire a pageview in Realtime.
Open DevTools → Network → filter 'plausible'. You should see exactly ONE request to plausible.io/js/script*.js per page load (the script load), and ONE request to plausible.io/api/event per pageview.
If you see TWO /api/event requests per page, you have a double-install (script loaded twice). If you see zero requests, the script is being blocked by an extension or the data-domain is wrong.
Bonus: use the Plausible browser extension (plausible.io/extension) — it shows a green checkmark on pages where tracking is firing correctly.
Common mistakes
Wrong script variant — missing outbound link tracking
What goes wrong: You install the basic plausible.js script. Three months in, you realize you have no data on outbound link clicks (which affiliate / partner / 'visit site' button generated traffic). You manually rebuild the data from referrer logs.
How to avoid: Pick all the variants you need upfront: plausible.outbound-links.file-downloads.tagged-events.js for most sites. Combine via dots in the script src URL.
data-domain mismatch with the registered site
What goes wrong: You registered 'acme.com' in Plausible but the script says data-domain='www.acme.com'. Events fire to a phantom site that does not exist. Dashboard stays empty forever. You assume Plausible is broken.
How to avoid: data-domain on the script tag MUST exactly match what you registered in Plausible Site Settings. No https://, no www unless you registered with www. Always copy the snippet directly from Site Settings → Tracking Code.
Double-install (manual snippet + WordPress plugin)
What goes wrong: You paste the snippet into theme.liquid (or header.php) for safety, then also install the official WordPress / Shopify plugin. Both fire. Every pageview counts twice. Your dashboard shows 20K pageviews but Stripe / Shopify show 10K real visitors.
How to avoid: Pick ONE install method per site. Audit DevTools → Network for duplicate /api/event requests per pageview — should be exactly one.
Script blocked by browser extension or corporate proxy
What goes wrong: You install Plausible, test on your office machine with no traffic showing. You assume the install is broken and spend 4 hours debugging. Turns out your office WiFi has a DNS-level analytics block.
How to avoid: Always validate the install in incognito on mobile data (not your office WiFi). Use the Plausible browser extension to confirm tracking is firing. Check DevTools → Network for the script load + /api/event request.
Installing in <body> instead of <head>
What goes wrong: The script loads but pageview events fire LATE on slow connections — sometimes after the user has navigated away. Bounce rate inflates because Plausible never registers the original pageview.
How to avoid: Always place the snippet in <head>, just before </head>. The defer attribute ensures it does not block render but still loads early enough to capture quick navigations.
Installing on Next.js App Router with the wrong strategy
What goes wrong: You use next/script with strategy='beforeInteractive'. Hydration fails silently. Pageviews fire on direct navigation but not on client-side route changes. Half your dashboard pageviews disappear.
How to avoid: Use strategy='afterInteractive' (default) in next/script. Place the script in app/layout.tsx inside <body>, outside any 'use client' boundary. Validate route-change tracking by clicking <Link> components and watching Realtime.
Recap
Done — what's next
How to set up a Plausible Analytics account the right way
Read the next tutorial
Hand it off
Install is the smallest part of a real Plausible deployment. Custom events, goals, funnels, UTM hygiene, and validating across every page template is where it pays back. A vetted Plausible specialist on EverestX can install + validate + add the first 5 goals in a 1-2 day sprint, typically $80-150 total at $14-16/hr.
See specialist rates
No meaningfully. The Plausible script is ~1KB gzipped — about 45x smaller than GA4 (~45KB). With the defer attribute, it does not block render. Plausible publishes their Lighthouse impact (typically <1ms TBT impact) at plausible.io/lightweight-web-analytics.
For platform-supported sites (WordPress, Webflow, Ghost, Framer), use the platform's plugin or settings panel — no code edit needed. For custom sites or platforms without a plugin, you must add the script tag manually. If you have GTM installed, you can also use Custom HTML in GTM (though see step 4 for caveats).
Project Settings → Custom Code → Head Code. Paste the Plausible snippet. Publish the site. Webflow handles the rest. data-domain must match exactly what you registered (use the staging vs production domain awareness — Webflow staging is yoursite.webflow.io, production is your custom domain).
Yes by default. If you use Cloudflare's Browser Insights or Web Analytics, those run separately and do not conflict. If you have Cloudflare Bot Fight Mode or aggressive Page Rules, verify plausible.io is not being blocked at the edge — visit Cloudflare → Security → Events and search for plausible.io.
Yes. Plausible supports proxying via your own subdomain (analytics.acme.com) — see plausible.io/docs/proxy. This bypasses some ad blockers that block plausible.io specifically. It is a 30-min setup if you are on Cloudflare or Vercel. Honest take: most Plausible users do not bother — ad blockers block fewer privacy-friendly trackers like Plausible than they block GA4.
plausible.js is the basic script — pageviews only. plausible.outbound-links.js is the same script plus auto-tracking of outbound link clicks. The variants combine: plausible.outbound-links.file-downloads.tagged-events.js loads three extensions together. The combined version is ~2KB gzipped — still tiny.
Plausible Analytics
Plausible is the easiest analytics tool to install — which is exactly why owners breeze through setup and lock in choices they later regret. The plan tier, timezone, and shared-link defaults are all hard to fix once data is flowing.
Plausible Analytics
Plausible's goal system is brutally simple — and that simplicity is what makes it powerful. Three types: pageview goals, custom events, and revenue goals. Most owners set up the wrong type, fire too many events, and blow past their plan. This is the discipline that prevents both.
Plausible Analytics
Custom properties are how Plausible lets you slice the data without GA4-level complexity. Logged-in vs anonymous, free vs paid, mobile vs desktop — every dimension you want to filter by needs to be a prop. Most owners never set them up. This is the walkthrough.
Plausible Analytics
DIY Plausible is the right call up to a point. Then it isn't. This is the honest framework: when the cost of self-managing exceeds the cost of hiring, and how to tell which side you're on.