Use Plausible analytics with Jekyll Chirpy theme
Use Plausible analytics with Jekyll Chirpy theme
In this post, we’ll see how to install Plausible analytics when using the Jekyll Chirpy theme.
Prerequisites
- A Plausible analytics server (self-hosted aka. Community Edition (CE) or cloud-based)
- A Jekyll website with the Chirpy theme
Installation
Plausible
Add a new website to your Plausible instance. You can find the documentation here.
Jekyll
- Add a new file
plausible.html
under_includes/analytics
. You may need to create this folder at the root. Its content is as follows:
1
2
3
4
5
6
<!-- Plausible -->
<script
defer
src="{{ site.analytics.plausible.domain }}/js/script.js"
data-domain="{{ site.analytics.plausible.id }}"
></script>
- Update your configuration file (
_config.yml
) with the following:
1
2
3
4
analytics:
plausible:
id: <placeholder> # The domain name used in Plausible
domain: <placeholder> # Your Plausible instance URL eg. https://plausible.example.com or https://plausible.io
This post is licensed under CC BY 4.0 by the author.