diff --git a/docs/change-domain-name.md b/docs/change-domain-name.md index c04e288c..2c6124da 100644 --- a/docs/change-domain-name.md +++ b/docs/change-domain-name.md @@ -55,7 +55,7 @@ First and foremost, you'll need to make sure your stats are still tracking. Whet WordPress plugin If your website is on WordPress, you're most likely using the plugin as that's the recommended installation method. - Update the site domain in your plugin settings + Update the site domain in your plugin settings NPM package diff --git a/docs/custom-automatic-link-tracking.md b/docs/custom-automatic-link-tracking.md index fcc3ff19..9802cb70 100644 --- a/docs/custom-automatic-link-tracking.md +++ b/docs/custom-automatic-link-tracking.md @@ -18,10 +18,6 @@ Instructions below can be used to start tracking every `` (i.e. link) element Here's how to automatically track clicks on cloaked affiliate links and other pretty URLs: -:::tip Our WordPress plugin can track cloaked affiliate links automatically -On WordPress? Check out our WordPress plugin which can track cloaked affiliate links automatically. [See more here](https://plausible.io/wordpress-analytics-plugin). -::: - ## 1. Add the JavaScript that will be sending the link click events to Plausible You need to add the following code to all of the pages where you want to track your links. You should insert the code below into your HTML page `` section just under the custom event snippet. diff --git a/docs/custom-event-goals.md b/docs/custom-event-goals.md index e3cfedc4..3b078ec3 100644 --- a/docs/custom-event-goals.md +++ b/docs/custom-event-goals.md @@ -15,7 +15,7 @@ Custom events let you measure button clicks, subscription signups or any other a - **Using CSS class names**: add a class to any HTML element you want to track. No JavaScript required. This is the easiest approach for most use cases and is covered in the first section below. - **Using JavaScript**: call the `plausible()` function directly for more advanced tracking needs such as dynamic values, conditional logic or tracking non-click interactions. See the [manual JavaScript approach](#trigger-custom-events-manually-with-a-javascript-function) section. -If you're using WordPress or Google Tag Manager, you can set up custom events with our [WordPress plugin](https://plausible.io/wordpress-analytics-plugin) or [GTM template](https://plausible.io/gtm-template) without writing code. Plausible also offers automated tracking for [outbound link clicks](outbound-link-click-tracking.md), [file downloads](file-downloads-tracking.md) and [form submissions](form-submissions-tracking.md) straight from your site settings, [pageview goals](pageview-goals.md) for tracking visits to specific pages and [404 error pages](error-pages-tracking-404.md) with a small snippet of code. +If you're using WordPress or Google Tag Manager, you can set up custom events with our [WordPress plugin](wordpress-integration.md#track-custom-events-with-css-class-names) or [GTM template](https://plausible.io/gtm-template) without writing code. Plausible also offers automated tracking for [outbound link clicks](outbound-link-click-tracking.md), [file downloads](file-downloads-tracking.md) and [form submissions](form-submissions-tracking.md) straight from your site settings, [pageview goals](pageview-goals.md) for tracking visits to specific pages and [404 error pages](error-pages-tracking-404.md) with a small snippet of code. ` or `` section of your 404 page template. -:::tip Using WordPress? -The quickest way to start tracking 404 error pages is to use our [official WordPress plugin](https://plausible.io/wordpress-analytics-plugin) -::: - ## Step 2: Create a `404` goal on your site 404 events won't show up in your dashboard automatically. You'll have to configure the goal for the conversion numbers to show up. diff --git a/docs/excluding.md b/docs/excluding.md index 3ee314cd..8fe42e64 100644 --- a/docs/excluding.md +++ b/docs/excluding.md @@ -11,7 +11,7 @@ Plausible automatically filters out bots, crawlers and referrer spam. You don't By default, Plausible Analytics tracks every visitor to your website. You might not want your office traffic to be counted. Or when you're working on your site, you might not want to record your own visits and page views. -Here's how to block your internal traffic from your Plausible Analytics stats dashboard. You can block recording visitors from specific IP addresses, hostnames, countries or pages. If you're on WordPress, our [official WordPress plugin](https://plausible.io/wordpress-analytics-plugin) can exclude views from admins and other user roles without any manual configuration. +Here's how to block your internal traffic from your Plausible Analytics stats dashboard. You can block recording visitors from specific IP addresses, hostnames, countries or pages. If you're on WordPress, our [official WordPress plugin](wordpress-integration.md#exclude-admins-and-other-roles) can exclude views from admins and other user roles without any manual configuration. ## Exclude visits by IP address diff --git a/docs/file-downloads-tracking.md b/docs/file-downloads-tracking.md index c1359dce..fc3406ff 100644 --- a/docs/file-downloads-tracking.md +++ b/docs/file-downloads-tracking.md @@ -34,10 +34,6 @@ After you enable file downloads tracking on your site, all the file downloads wi Heads up: File download tracking only works for clicks that happen on your tracked pages. If you share a direct link to a file in an email or elsewhere, those opens won't be counted. Visitors need to arrive at your site first and click the link from there. -:::tip Using WordPress? -The quickest way to start tracking file downloads is to use our [official WordPress plugin](https://plausible.io/wordpress-analytics-plugin) -::: - ## See all the file download clicks in your dashboard Click on **File Download** goal in the **Goals** tab of your Plausible dashboard to see the full list of all clicks on all files and have your dashboard filtered by file download clicks only. You can see: diff --git a/docs/form-submissions-tracking.md b/docs/form-submissions-tracking.md index 56534728..e74606f9 100644 --- a/docs/form-submissions-tracking.md +++ b/docs/form-submissions-tracking.md @@ -26,10 +26,6 @@ You can enable **Form submissions** as an optional measurement when adding a new After you enable form submissions tracking, we will automatically add a new goal called `Form: Submission` to your site. -:::tip Using WordPress? -The quickest way to start tracking form submissions is to use our [official WordPress plugin](https://plausible.io/wordpress-analytics-plugin) -::: - ## See all the form submissions in your dashboard Click on **Form: Submission** goal in the **Goals** tab of your Plausible dashboard to see the full list of all form submissions and have your dashboard filtered by them. You can see: diff --git a/docs/outbound-link-click-tracking.md b/docs/outbound-link-click-tracking.md index 9ea68ece..b1592e6f 100644 --- a/docs/outbound-link-click-tracking.md +++ b/docs/outbound-link-click-tracking.md @@ -32,10 +32,6 @@ By default, **Outbound links** is enabled when adding a new site to your Plausib After you enable outbound link click tracking, we will automatically add a new goal called `Outbound Link: Click` to your site. -:::tip Using WordPress? -The quickest way to start tracking outbound link clicks is to use our [official WordPress plugin](https://plausible.io/wordpress-analytics-plugin) -::: - ## See all the outbound link clicks in your dashboard Click on **Outbound Link: Click** goal in the **Goals** tab of your Plausible dashboard to see the full list of all clicks on all external links and have your dashboard filtered by external clicks only. You can see: diff --git a/docs/plausible-script.md b/docs/plausible-script.md index a0aa9992..5d7264b5 100644 --- a/docs/plausible-script.md +++ b/docs/plausible-script.md @@ -33,7 +33,7 @@ You can add your main domain name as a site to your Plausible account and use th Installing Plausible on a site can be a slightly different process depending on what tools you're using to manage your site. -- Are you using WordPress? We recommend you integrate Plausible by using our plugin. It's very lightweight, excludes your visits by default and allows you to see the stats directly in your WordPress dashboard. It also avoids conflicts with WP Rocket and similar plugins. [See more here](https://plausible.io/wordpress-analytics-plugin) +- Are you using WordPress? Use our [official plugin](wordpress-integration.md) instead of adding the snippet manually. It excludes your own visits by default, lets you see the stats directly in your WordPress dashboard and avoids conflicts with WP Rocket and similar caching plugins. - Are you using Google Tag Manager? We have a guide on [how to integrate Plausible with our GTM template](https://plausible.io/gtm-template) diff --git a/docs/proxy/guides/wordpress.md b/docs/proxy/guides/wordpress.md index d59774e8..5d1ed0aa 100644 --- a/docs/proxy/guides/wordpress.md +++ b/docs/proxy/guides/wordpress.md @@ -6,4 +6,4 @@ description: "How to proxy Plausible Analytics on WordPress using the official p import useBaseUrl from '@docusaurus/useBaseUrl'; -You can use our official WordPress plugin to proxy your Plausible Analytics requests. It takes only a few minutes and requires no tech know-how or prior experience. Check full instructions and details on the other features of our [WordPress plugin here](https://plausible.io/wordpress-analytics-plugin). +You can use our official WordPress plugin to proxy your Plausible Analytics requests. It takes only a few minutes and requires no tech know-how or prior experience. For setup, the other plugin features and troubleshooting, see [Adding Plausible to WordPress](../../wordpress-integration.md). diff --git a/docs/troubleshoot-integration.md b/docs/troubleshoot-integration.md index 566aa099..8d2d8de6 100644 --- a/docs/troubleshoot-integration.md +++ b/docs/troubleshoot-integration.md @@ -187,6 +187,8 @@ Plausible is privacy-first and compliant with GDPR and ePrivacy regulations. You ## WordPress plugin issues +These cover the most common plugin problems. For full setup and every plugin setting, see [Adding Plausible to WordPress](wordpress-integration.md). + ### Admin visits are not showing Our WordPress plugin excludes logged-in administrator visits by default. This is intentional. If you want to track your own visits, go to the "Track analytics for user roles" section in the plugin settings and enable the Administrator role. @@ -206,6 +208,14 @@ Skipping any step often leaves a stale script in place that the verification too The proxy creates a randomly named file in `/wp-content/uploads/`. When you migrate or clone your site, that file path may no longer match what the plugin expects. To fix this, disable the proxy, clear all caches, re-enable the proxy and clear all caches again. This forces the plugin to generate a fresh proxy file at the correct path. +### Proxy script is slow + +The plugin notifies you if the proxy takes too long (over 500ms) to send pageviews. This usually means the speed module failed to install automatically. To install it manually: + +1. Access your server using (S)FTP, SSH or your host's file manager +2. Go to the plugin directory, usually `wp-content/plugins/plausible-analytics` +3. Open the `mu-plugin` directory inside it and copy `plausible-proxy-speed-module.php` to `wp-content/mu-plugins` (create the `mu-plugins` folder first if it doesn't exist) + ### Plugin token showing as invalid Plugin tokens are site-specific. Make sure the token you are pasting was created for the exact domain you are trying to connect. Tokens always start with `plausible-plugin-`. If in doubt, create a new token in your Plausible site settings and connect it again. diff --git a/docs/wordpress-integration.md b/docs/wordpress-integration.md index cec2a38a..9913869e 100644 --- a/docs/wordpress-integration.md +++ b/docs/wordpress-integration.md @@ -2,14 +2,15 @@ displayed_sidebar: someSidebar title: Adding Plausible to WordPress sidebar_label: WordPress -description: "Add Plausible Analytics to your WordPress site using the official plugin. Cookie-free, privacy-first tracking with proxy and goal tracking support." +description: "Install and configure the official Plausible WordPress plugin: token setup, enhanced measurements, ecommerce revenue, proxy and viewing stats inside WordPress." --- +import useBaseUrl from '@docusaurus/useBaseUrl'; import CtaBox from '@site/src/components/CtaBox'; -The best way to add Plausible to your WordPress site is our official WordPress plugin. It gives you a Plausible configuration page directly in your WordPress dashboard, with options for the proxy, goal tracking and more. +The best way to add Plausible to your WordPress site is our official plugin. It gives you a Plausible configuration page directly in your WordPress dashboard, with one-click options for goal tracking, ecommerce revenue, the proxy and more. No code required. -For full installation instructions, setup options and feature details, visit the [Plausible WordPress plugin page](https://plausible.io/wordpress-analytics-plugin). +This page covers everything the plugin can do. If you only want a quick start, the first two sections (install and connect) are all you need. -## Common issues +## Install the plugin -Having trouble with the plugin? Jump to the relevant section: +You need a Plausible account before the plugin can send data. [Register your account](register-account.md) and [add your website](add-website.md) first. Enter your domain without `https` or `www`, so `https://www.yourdomain.com` becomes `yourdomain.com`. -- **No data being recorded**: check that the plugin is activated, the domain name matches your Plausible account exactly and all caches have been cleared -- **Admin visits not showing**: the plugin excludes logged-in administrators by default; enable your user role in the plugin settings to track your own visits -- **Proxy not working after setup or site migration**: the proxy requires a specific reset sequence; [see WordPress plugin issues](troubleshoot-integration.md#wordpress-plugin-issues) for the full steps -- **Plugin token showing as invalid**: tokens are site-specific and start with `plausible-plugin-`; generate a new one from your Plausible site settings if in doubt -- **WP Rocket or another caching plugin is interfering**: add the Plausible script to the exclusion list in your caching plugin's settings +Then install the plugin from your WordPress dashboard: -For a full diagnostic walkthrough, see the [troubleshooting guide](troubleshoot-integration.md). +1. Go to the **Plugins** section in the left-hand navigation. +2. Click **Add Plugin** and search for "Plausible Analytics". +3. Open the official listing, then **Install** and **Activate**. + +
+ Search and install the official Plausible Analytics WordPress plugin +
+ +You can also install it from the [official plugin directory](https://wordpress.org/plugins/plausible-analytics/). After activation, the plugin walks you through a Get Started guide. Every option there is also available later in the plugin settings screen, described below. + +
+ Activate the Plausible Analytics WordPress plugin +
+ +## Connect with a plugin token + +In the **Domain Name** field, enter your domain exactly as added to your Plausible account (no `https` or `www`). + +To manage everything from WordPress without visiting your Plausible account, generate a plugin token: + +1. Click the token link in the plugin settings. It takes you to plausible.io. +2. Click **Create Plugin Token** and copy the token. +3. Back in the plugin, paste it into the **Plugin Token** field and click **Connect**. + +
+ Add your Plausible plugin token in WordPress +
+ +Your site is now being tracked. You can confirm tracking from your [site settings](website-settings.md) at any time. + +:::note Seeing an "invalid token" error? +Plugin tokens are site-specific and always start with `plausible-plugin-`. Make sure the token was created for the exact site you are connecting, and generate a new one if in doubt. +::: + +## The settings screen + +The full settings screen has a few options pre-enabled. Keep them as-is or turn off anything you don't need. + +
+ Plausible Analytics WordPress plugin settings +
+ +## Enhanced measurements + +The **Enhanced measurements** section is where you enable automatic tracking for common actions. Toggle one on and tracking starts immediately. Each goal or property appears in your dashboard as soon as its first event is recorded. [Ecommerce revenue](#track-ecommerce-revenue) has its own section below. + +### 404 error pages + +Enable **404 error pages** to track visits to missing pages. A **404** goal appears, with the missing path recorded as a property. [Full reference](error-pages-tracking-404.md). + +### File downloads + +Enable **File downloads** to track downloads of PDFs, documents, media and other common file types. A **File Download** goal appears. [Full reference](file-downloads-tracking.md). + +### Outbound links + +Enable **Outbound links** to track clicks on links pointing to other sites. An **Outbound Link: Click** goal appears. [Full reference](outbound-link-click-tracking.md). + +### Cloaked affiliate links + +Enable **Cloaked affiliate links** and enter the URL slugs you use for cloaked links, such as `/recommends/`. Clicks appear as a **Cloaked Link: Click** goal. [Full reference](custom-automatic-link-tracking.md). + +### Form completions + +Enable **Form completions** to track successful form submissions. Tested with Contact Form 7, WPForms, Ninja Forms and Elementor, and works with most other form plugins. A **WP Form Completions** goal appears. [Full reference](form-submissions-tracking.md). + +### Search queries + +Enable **Search queries** to track what people search for on your site. A **WP Search Queries** goal appears, with the search term, result count and source page recorded as properties. + +### Authors and categories + +Enable **Authors and categories** to send post authors, categories and custom taxonomies as [custom properties](/custom-props/introduction). You can then filter the dashboard by a specific author or category. + +### Logged-in user status + +Enable **Logged-in user status** to record whether a visitor is logged in, as a `user_logged_in` property available across your dashboard filters. + +### Hash-based routing + +Enable **Hash-based routing** if your site uses hash URLs such as `/#contact`. The hash is preserved in your **Top Pages** report. [Full reference](hash-based-routing.md). + +### Query parameters + +Enable **Query parameters** and enter the parameters you want to keep, such as `lang`. Matching values appear in the **Properties** tab. [Full reference](custom-query-params.md). + +## Track custom events with CSS class names + +You can track any button or element click as a goal without writing JavaScript. Tag the element with a CSS class directly in the WordPress editor. + +1. Select the block you want to track to open the block menu. +2. Under **Advanced**, add a class in the **Additional CSS class(es)** field using the format `plausible-event-name=YourEventName`. For a signup button: `plausible-event-name=Signup+Submit` (a `+` becomes a space). + +
+ Add a CSS class name to a WordPress block +
+ +The event won't appear until you add a matching goal. In your [site settings](website-settings.md), open **Goals**, click **+ Add goal**, choose **Custom event** and enter the event name (`Signup Submit` for the example above). See [custom event goals](custom-event-goals.md) for the full reference. + +### Send custom properties with events + +Add custom properties to segment an event further. To record where a shared button was clicked, append `plausible-event-position=footer` to the class: + +``` +plausible-event-name=Signup+Submit plausible-event-position=footer +``` + +Properties show up automatically once the goal exists. See [custom properties](/custom-props/introduction) for more. + +## Track ecommerce revenue + +The plugin has built-in support for [WooCommerce](https://plausible.io/blog/woocommerce-analytics-plugin) and Easy Digital Downloads. Enable **Ecommerce revenue** in **Enhanced measurements** and the plugin automatically tracks these events: + +- Add to Cart +- Remove from Cart +- Start Checkout +- Complete Purchase (including revenue) +- Visit `/product*` + +It also records product properties (`product_name`, `product_cat`, `price`, `cart_total`, `quantity` and more) and builds a purchase funnel from product view to completed purchase, so you can see where customers drop off. No code or custom event setup is required. + +
+ Ecommerce revenue goal in Plausible +
+ +If your store doesn't run on WooCommerce or Easy Digital Downloads, you can send revenue manually. See [ecommerce revenue tracking](ecommerce-revenue-tracking.md) for the full reference. + +## View your stats inside WordPress + +You can see your Plausible dashboard inside WordPress without visiting our website. Enable **View stats in WordPress** in the plugin settings, then open **Dashboard → Analytics** in the WordPress admin menu. + +Stats are visible to administrators by default. Under **Show stats dashboard to additional user roles**, you can also grant access to editors, authors and contributors. + +## Exclude specific pages from tracking + +In **Exclude specific pages from being tracked**, add a comma-separated list of page paths to leave out of your stats. Each entry must start with `/` and omit the trailing slash. Use `*` as a wildcard, for example `/subdirectory-to-exclude*` to exclude everything under a directory. + +## Exclude admins and other roles + +By default the plugin excludes logged-in **administrator** visits so your own activity stays out of the stats. In **Track analytics for user roles**, you can also exclude editors, authors and contributors, or enable any role you do want to count. See [excluding visitors](excluding.md) for other ways to filter internal traffic. + +## Disable the toolbar menu + +By default the plugin adds a shortcut to the WordPress toolbar so you can jump to analytics for the page you're viewing. Toggle it off in the settings if you prefer a cleaner toolbar. + +## Bypass adblockers with the proxy + +Plausible's script is blocked far less than Google Analytics, but some blocklists block every analytics script regardless of privacy practices. The proxy serves our script as a first-party request from your own domain so you keep complete data. + +In the **Bypass adblockers** section, turn on **Enable proxy**. If you use a caching plugin, clear its cache afterward. + +
+ Enable the proxy in the Plausible WordPress plugin +
+ +The proxy uses WordPress' API with a randomly generated endpoint under `yourdomain.com/wp-json` and creates a randomly named file in `/wp-content/uploads/`. If stats stop after enabling the proxy or after a site migration, see [WordPress plugin issues](troubleshoot-integration.md#wordpress-plugin-issues). + +## Troubleshooting + +Most plugin problems come down to caching, admin exclusion, an invalid token or a proxy reset. For step-by-step fixes, see [WordPress plugin issues](troubleshoot-integration.md#wordpress-plugin-issues). ## What's next? -- [Enable enhanced measurements](script-extensions.md) in the plugin settings to automatically track outbound links, file downloads and form submissions without writing code -- [Set up goals](goal-conversions.md) to measure signups, purchases or any other key action on your site +- [Set up goals](goal-conversions.md) to measure signups, purchases or any other key action - [Import your Google Analytics history](google-analytics-import.md) to keep your stats continuous if you're switching from GA +- [Connect Looker Studio](looker-studio.md) for custom reporting across your data sources