The Plausible Events API can be used to record pageviews and custom events. This is useful when tracking mobile apps or for server side tracking.
In most cases we recommend installing Plausible via our provided script or one of the many interation packages listed here. However, if there's no easy way for you to integrate with Plausible, you can still do so by sending events directly to our API.
Records a pageview or custom event. When using this endpoint, make sure you're sending the correct headers:
User-agent is used to determine the user's device
X-Forwarded-For is used to determine the client's IP address
Content-Type must be either application/json or text/plain
In combination, these two values are used for unique user counting. If you have problems with uniqueness counting, please make sure you are sending User Agent and X-Forwarded-For correctly.
Domain name of the site in Plausible
Name of the event. Can specify
pageview which is a special type of event in Plausible. All other names will be treated as
URL of the page where the event was triggered. If the URL contains UTM parameters, they will be extracted and stored. When using the script,
this is set to
Referrer for this event. When using the script, this is set to
Width of the screen. When using the script, this is set to
Custom properties for the event. See: https://plausible.io/docs/custom-event-goals#using-custom-props