Skip to main content

Extensions

Plausible provides optional script extensions for tracking events such as outbound-link clicks and file downloads. Enable them with plugin options; the plugin builds the script filename from those options.

For example, enabling hashBasedRouting and outboundLinks loads:

https://plausible.io/js/plausible.hash.outbound-links.js

Use the Config Playground to see the exact filename and URL for any combination.

hashBasedRouting​

Tracks navigation when a single-page app uses the URL fragment for routes, such as example.com/#/about.

{ hashBasedRouting: true }

Sends a Link: Click event when a visitor clicks a link to an external domain.

{ outboundLinks: true }

fileDownloads​

Sends a File Download event when a visitor clicks a link to a tracked file type.

// Use defaults (pdf, zip, docx, and ~20 more)
{ fileDownloads: true }

// Replace the default list
{ fileDownloads: { extensions: ['pdf', 'zip'] } }

// Add to the default list
{ fileDownloads: { addExtensions: ['sketch', 'fig'] } }

taggedEvents​

Sends a custom event for an HTML element with the data-analytics attribute. Add the attribute in your markup; you don't need to add an event listener.

<button data-analytics='"Signup"'>Sign up</button>
{ taggedEvents: true }

revenue​

Enables revenue tracking. Pass a revenue object with currency and amount when calling window.plausible.

{ revenue: true }

captureOnLocalhost​

Plausible ignores events from localhost by default. Enable this option to track local visits.

{ captureOnLocalhost: true }

manualPageviews​

Disables the pageview Plausible would normally send when its script loads. The plugin still sends pageviews when the Docusaurus route changes, using window.plausible('pageview').

Use this when you send the initial pageview yourself or need to avoid a duplicate on page load. To exclude routes from the plugin's route-change pageviews, use excludePaths.

{ manualPageviews: true }

compat​

Loads Plausible's compatibility script for browsers that block the standard tracker.

{ compat: true }

pageviewProps​

Attaches custom properties to each automatic pageview. Set the values on window.plausible.pageviewProps, for example to segment traffic by plan or locale.

{ pageviewProps: true }