Goals & Conversions

Plausible gives you an option to specify and track goals. Goals are actions that you want your users to take, for example visiting a specific page URL, signing up to your newsletter, hitting a 'download' button, or completing the checkout form of an e-commerce store.

There are two types of goals in Plausible. Since pageviews are collected automatically, you don't need to change your website's code to measure page URL goals. However, if you want to track custom events like button clicks or form completions, you have to trigger these custom events from your website using JavaScript.

You can enable a cookie in the Plausible script to get better referrer data for goal completions. Read more

1. Pageview goals

Pageview goals allow you to measure how many people visit a specific page URL. To get started, go to your website's settings and scroll down to the Goals section. You should see an empty list with a prompt to add a goal

Hit the 'add goal' button to go to the goal creation form

Select Pageview as the goal trigger and enter the pathname of the page you would like your visitors to hit. The pathname must match the page path you can see in your analytics dashboard.

Next, hit the 'add goal' button and you'll be taken back to the goals page. When you navigate back to your analytics dashboard, you should see the number of visitors who reached the specified page. Goal conversions are listed at the very bottom of the dashboard.

2. Custom event goals

Trigger custom events with Javascript

To track custom events, you have to trigger them with Javascript. First, make sure your tracking setup includes the second line as shown below

<script async defer data-domain="<your-domain.com>" src="https://plausible.io/js/plausible.js"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>

This snippet creates a global function called plausible which can be used to trigger custom events from anywhere in your code.

Here's what triggering a custom event looks like

plausible('Signup')

The event name can be anything. As a second parameter, you can also send an object with options. The only supported option at the moment is callback – a function that is called once the event is logged successfully.

This is the whole extent of the API. If you want to trigger form submissions, button clicks, etc. you need to implement the code for that yourself.

Create a custom event goal in Plausible

When you start sending custom events to Plausible, they won't show up automatically. You'll have to configure the goal for the conversion numbers to show up.

To configure a goal, go to your website's settings and scroll down to the Goals section. You should see an empty list with a prompt to add a goal

Hit the 'add goal' button to go to the goal creation form

Select Custom event as the goal trigger and enter the name of the custom event you are triggering. The names must be an exact match for the conversions to show up in your analytics dashboard.

Next, hit the 'add goal' button and you'll be taken back to the goals page. When you navigate back to your analytics dashboard, you should see the number of visitors who triggered the custom event. Goal conversions are listed at the very bottom of the dashboard.

Referrer tracking for conversions

The Plausible snippet that you include on your site does not set any cookies by default. Without cookies, it is impossible for us to track which referrers are driving conversions. If you would like to capture this information, you can enable a special cookie for acquisition tracking:

<script async defer data-track-acquisition data-domain="<your-domain.com>" src="https://plausible.io/js/plausible.js"></script>

The data-track-acquisition tells Plausible to use a cookie for referral tracking. You don't have to take any extra steps for this to work, once you include the attribute we'll start tracking referrers and you should be able to see them on your dashboard when you click on the goal.