analytics-plugin-plausible
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

Analytics Plausible Plugin

This adds Analytics support for Plausible

Installation

npm install analytics analytics-plugin-plausible --save

Usage

import Analytics from "analytics"
import plausiblePlugin from "analytics-plugin-plausible"

const analytics = Analytics({
  app: "myapp",
  plugins: [
    plausiblePlugin({
      domain: "example.com", // By default window.location.hostname
      hashMode: true, // By default 'false'
      trackLocalhost: true, // By default 'false'
      apiHost: "https://my-plausible-api.domain.com/", // By default 'https://plausible.io'
    }),
  ],
})

Options

plausiblePlugin() accepts some options that you may want to provide:

Option Type Description Default
domain string Your site's domain, as declared by you in Plausible's settings location.hostname
hashMode bool Enables tracking based on URL hash changes. false
trackLocalhost bool Enables tracking on localhost. false
apiHost string Plausible's API host to use. Change this if you are self-hosting. 'https://plausible.io'

/analytics-plugin-plausible/

    Package Sidebar

    Install

    npm i analytics-plugin-plausible

    Weekly Downloads

    177

    Version

    0.0.6

    License

    MIT

    Unpacked Size

    7.21 kB

    Total Files

    5

    Last publish

    Collaborators

    • 01studio
    • ian_