Goals & Conversions

Plausible gives you an option to specify and track goals. Goals are specific 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.

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 custom Javascript on the page you're running Plausible. When you include the Plausible tracking code, it creates a global function called plausible that you can interact with. Here's what triggering a custom event looks like

plausible('trigger', eventName, opts)

The event name is up to you. 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.