Home » Recommended Plugins » Plausible Analytics WordPress Integration with a Plugin

Plausible Analytics WordPress Integration with a Plugin

Before you start this guide about Plausible Analytics WordPress integration, you need to read our guide about Plausible Analytics and how to sign up for the service. After that, you may install the plugin in WordPress.

Installing Plausible Analytics WordPress Integration Plugin

You can install the plugin using our WordPress Plugin Installation Guide article in our Complete SEO Guide Box.
In your WordPress plugin management panel, search for the plugin: Plausible Analytics By Plausible.io.

Setting Up Plausible Analytics for WordPress Integration

Login to your WordPress Dashboard.
On the left side menu, hover with the mouse cursor over [Settings], then click on [Plausible Analytics].

Setting up Using Wizard

  • At this point, you will be redirected to the “Plausible Analytics Getting Started Guide” welcome screen.
    Click [Next].
  • At the “Confirm Domain” page, set the domain name of your website:
    Domain name: yourdomain.com
    Click [Next].
  • On the “Create API token” page,
    Click the “Create the API token” to open a new browser window.
    • Login to Plausible.
      Note: if you don’t see the API token immediately, close the new browser window and click the link again.
    • [COPY] the token, then click [Add token].
    • You may close this window and return to the WordPress plugin page.
  • Paste the text into the “API token” field.
    Click [Next].
  • On the “View the stats in your WP dashboard” page,
    You may turn on the Plausible Dashboard view in your WordPress Admin panel. We prefer not to add additional processes to our database or site code if it is not a critical feature. We can check the Plausible site for the analytics perfectly well. So, this option stays off.
  • On the “Enhanced measurements” page, enable these options:
    • 404 error pages: This option will track all the 404 errors users encounter on your domain. This means that if a user tries to navigate to a URL “https://www.yourdomain.com/non-existing-page,” this option will track it.
    • Outbound links: This option will track all the links users click on your website.
    • Authors and categories: This is not mandatory, but it will give you extra statistics on several articles inside a specific category or written by a particular author to understand what category or author are popular.
    • Hash-based routing: This is also not mandatory. However, if you have a Table of Contents in posts or use anchor links with the “#” sign, this option will give you statistics about clicks on these links. Plausible doesn’t have this enabled by default.
    • IE compatibility: Microsoft Internet Explorer slowly fades away, but some users might still use it.
  • Click [Next]
  • On the “Enable proxy” page,
    Turn on “Enable proxy.” Some adblockers block script execution from third-party domains. By default, Plausible Analytics runs the counter JavaScript file from their domain, which means that if it is blocked, the users that use this type of adblockers will not be counted. This proxy will add routing for this JavaScript file as it was served from your domain, so adblockers will not stop script execution.
    Click [Next].
  • Now you can [Visit plugin settings].

Setting up Manually

“Enhanced measurements” section.

Enable the events that we listed in the Wizard Setup from above.
“404 error pages” and “Outbound links” are additional statistics that Plausible Analytics can gather for your site. There are more events in this section; check if you need them. After you enable the plugin’s actions, you also need to allow them to be in the Plausible console. We will later enable “404 error pages” and “Outbound links” in the Plausible console.

“Disable menu in toolbar” section.

Fill in the check box:
[V] Disable toolbar menu
We would want to turn off clutter in the top admin toolbar. You will check the statistics on the Plausible Analytics website.

Click [SAVE CHANGES].

Return to the Plausible Analytics page.

To continue Plausible Analytics WordPress Integration, open a new tab in your browser, navigate to the Plausible Analytics website, and log in.
Click the rectangle with your site domain.
Remember the number of visitors.

Open another tab and navigate to your site.

The tab with the Plausible console should change to the first visitor.

Note: if you use JavaScript aggregation plugins and you have problems that you don’t see your visits in the console, it means that you need to exclude the path:

{{pre}}*/wp-json/*{{/pre}}

from JavaScript aggregation. We already did that in the settings since we use the Clearfy Cache plugin. If not, go over the settings again and exclude this path.

You can use our Performance speed-checking guide to ensure everything’s loading fine. Test your site with GTmetrix Waterfall or the Network tab of your browser developer tools. After the page loads, check that you don’t see any errors.

After we enabled “Outbound links” in the Plausible Analytics WordPress Integration plugin, we need to allow them in the console.
Login to your Plausible console.
Click the Gear icon Settings button inside your domain rectangle.

On the left side menu, click [Goals].
On the “Goals” page, click [+ Add goal].
On the “Add goal for <yourdomain.com>” page, in the “Goal trigger” option, select [Custom event].
In “Event name,” write “Outbound Link: Click”, so it will look like this:

{{pre}}Event name: Outbound Link: Click{{/pre}}

Click [Add goal].

Return to the Plausible home page and click on your site.
Now, on the bottom of the Analytics page, you will see “Outbound Link: Click” in the Goals section.
This will track clicks on your site.

If you have affiliate links, you can track them in this section when people start to click on these links.

You can click the goal to expand it and make a search for the domain of your affiliate to see how many users clicked on it.

Enabling 404 Error Pages in Plausible Analytics Console

As with “Outbound links,” we must add 404 error page tracking on your site.
This feature doesn’t track error links inside your content. It tracks URLs that users try to navigate on your site directly and get 404. For example, you have a post:

{{pre}}https://www.yoursite.com/some-post{{/pre}}

but someone entered the URL with typos:

{{pre}}https://www.yoursite.com/sooommmeee-ppost{{/pre}}

This post doesn’t exist and will appear under the 404 error section on the Plausible Analytics console.

Login to your Plausible console.
Click the Gear icon Settings button inside your domain rectangle.
On the left side menu, click [Goals].
On the “Goals” page, click [+ Add goal].
On the “Add goal for <yourdomain.com>” page, in the “Goal trigger” option, select [Custom event].
In “Event name,” write “404”, so it will look like this:

{{pre}}Event name: 404{{/pre}}

Click [Add goal].

Return to the Plausible home page and click on your site.
Now, on the bottom of the Analytics page, you will see “404” in the Goals section.

Enable Proxy to Avoid Adblockers Blocking Your Analytics

Let’s check how your analytics work.

Open the Developer’s tools [F12] of your browser and click the [Network] tab.
Navigate to your site.
Refresh the page while the [Network] tab is open.
You will see two requests to “plausible.io”.
One request is a JavaScript of the Plausible Analytics WordPress Integration plugin, and the second is a POST request responsible for the page views count.
Some adblockers may block requests to 3rd party domains that aren’t your domain. With the current setup, you will not see a count of users implementing such an ad blocker.

Plausible Analytics WordPress Integration plugin has a poxy option that will serve all the requests to your domain and proxy the request to “plausible.io” by itself. In this case, the ad blockers should not block such requests.

Login to your WordPress Dashboard.
On the left side menu, hover with your mouse cursor over [Settings], then click on [Plausible Analytics].

In the “Bypass ad blockers” section, enable the option:
[V] Enable proxy

Click [Save Changes].

Navigate again to your site with the [Network] tab open in the Developer Tools, and you will see that both requests are now going to your domain.

Bonus Material for Advanced Users

Plausible Analytics is an open-source platform. You don’t have to use their service and pay. You can get the files from the Plausible Analytics GitHub page and install the platform on your own hosting.

In addition, you can use your own proxy service. Here’s a Plausible article on installing the script on CloudFlare and using it as a proxy.

 

If you find any mistakes or have ideas for improvement, please follow the email on the Contact page.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.