Skip to main content

Plausible.io Events API

Project description

plausible-events

This small library allows to easily use the Plausible Events API.

  • Privacy-focused. Uses the open-source and privacy-focused Plausible Analytics. IP addresses are only used to correctly count unique users and for approximate geolocation, but are never stored (also not by ipify, which is used to obtain the public IP address of the caller).
  • Doesn't slow down the main application. Calls to record events are non-blocking, the necessary http requests happen on a separate thread.
  • Doesn't show errors, but tries again. Failed event recordings are re-tried indefinitely, i.e. events aren't lost if network connectivity is temporarily interrupted.

Examples

from plausible_events import PlausibleEvents

# create object to record events for your plausible.io domain
pe = PlausibleEvents(domain='my.domain.com')

# record a page view event with a (hypothetical) path
pe.pageview('/login/user')

# record a custom event with additional custom properties
pe.event('my event', dict(os='mac', var='foo'))

What is Plausible Analytics?

Plausible Analytics is a transparent and fully open source analytics software. From their website:

Plausible is open source analytics. Our source code is available and accessible on GitHub so anyone can read it, inspect it and review it to verify that our actions match with our words. We welcome feedback and have a public roadmap. If you're happy to manage your own infrastructure, you can self-host Plausible too.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plausible-events-0.1.0.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

plausible_events-0.1.0-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page