Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bt-rb/bridgetown-plausible
Plausible Analytics Bridgetown Plugin
https://github.com/bt-rb/bridgetown-plausible
bridgetown bridgetown-automation bridgetown-plugin bridgetown-tag erb liquid
Last synced: 28 days ago
JSON representation
Plausible Analytics Bridgetown Plugin
- Host: GitHub
- URL: https://github.com/bt-rb/bridgetown-plausible
- Owner: bt-rb
- License: mit
- Created: 2021-02-06T09:40:33.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-10-11T22:42:42.000Z (about 2 years ago)
- Last Synced: 2024-08-09T02:54:20.991Z (3 months ago)
- Topics: bridgetown, bridgetown-automation, bridgetown-plugin, bridgetown-tag, erb, liquid
- Language: Ruby
- Homepage:
- Size: 28.3 KB
- Stars: 11
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
bridgetown-plausible
[Plausible](https://plausible.io) 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](https://docs.plausible.io/plausible-script) to your Bridgetown site.
## Table of contents
- [Table of contents](#table-of-contents)
- [Quickstart](#quickstart)
- [System requirements](#system-requirements)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Liquid](#liquid)
- [ERB](#erb)
- [Changelog](#changelog)
- [Contribution](#contribution)
- [License](#license)## Quickstart
Use the automation to add to your site:
```sh
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`:
```bash
bundle add bridgetown-plausible -g bridgetown_plugins
```or add manually in `Gemfile`:
```ruby
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
```yml
# bridgetown.config.ymlplausible:
# 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
```liquid
{% plausible %}
```### ERB
```erb
<%= plausible %>
```## Changelog
Detailed changes for each release are documented in the [release notes](https://github.com/bt-rb/bridgetown-plausible/releases).
## Contribution
Please make sure to read the [Contributing Guide](.github/CONTRIBUTING.md) before making a pull request.
## License
[MIT](https://opensource.org/licenses/MIT)
Copyright (c) 2021-present, Andrew Mason