Low commit activity in last 3 years
No release in over a year
Provides a Liquid Tag and ERB Helper to add Plausible analytics to your Bridgetown site.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
~> 13.0
~> 3.0
~> 0.12

Runtime

>= 0.16, < 2.0
 Project Readme

Gem Version test lint release

bridgetown-plausible

Plausible is a lightweight and open-source website analytics tool. It doesn’t use cookies and is fully compliant with GDPR, CCPA and PECR. This plugin is meant to remove all friction from adding your Plausible Analytics tracking script code to your Bridgetown site.

Table of contents

  • Table of contents
  • Quickstart
  • System requirements
  • Installation
  • Configuration
  • Usage
    • Liquid
    • ERB
  • Changelog
  • Contribution
  • License

Quickstart

Use the automation to add to your site:

bundle exec bridgetown apply https://github.com/bt-rb/bridgetown-plausible

System requirements

  • Ruby >= 2.5
  • Bundler
  • Bridgetown >= 0.16

Installation

Automatically add to Gemfile:

bundle add bridgetown-plausible -g bridgetown_plugins

or add manually in Gemfile:

group :bridgetown_plugins do
  gem "bridgetown-plausible", "~> 1.1.0"
end

Run bundle install and then modify your bridgetown.config.yml configuration to point to your Plausible domain.

Configuration

# bridgetown.config.yml

plausible:
  # Your Plausible domain.
  # Note that this domain should not include www or https://
  #
  # Type: String
  # Required: true
  domain: example.com
  # Your Plausible instance domain.
  # Only set this if you are self-hosting Plausible on your own domain.
  # Requires https.
  #
  # Type: String
  # Required: false
  # Default: "plausible.io"
  server: selfhosted-plausible.com

Usage

This plugin provides the plausible Liquid tag & ERB helper to your site. If BRIDGETOWN_ENV is not production, than the tag will be wrapped in an HTML comment to prevent console erros in development. Make sure you set BRIDGETOWN_ENV="production" when you deploy in your script or in Netlify/Vercel/etc.

Use the tag in the head of your document:

Liquid

{% plausible %}

ERB

<%= plausible %>

Changelog

Detailed changes for each release are documented in the release notes.

Contribution

Please make sure to read the Contributing Guide before making a pull request.

License

MIT

Copyright (c) 2021-present, Andrew Mason