Skip to content

Commit 89329af

Browse files
committed
Document plausible-analytics new config
1 parent 462f4db commit 89329af

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

docs/websites/website-tools.qmd

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,53 @@ image: false
211211
---
212212
```
213213

214+
## Plausible Analytics
215+
216+
[Plausible Analytics](https://plausible.io/) is a lightweight, open-source, and privacy-friendly alternative to Google Analytics. Plausible is designed with privacy as a core principle: it doesn't use cookies, is GDPR compliant by default, and all data is processed anonymously.
217+
218+
To add Plausible Analytics to your Quarto website:
219+
220+
1. Sign up at [plausible.io](https://plausible.io/) and add your website to your account.
221+
2. In your Plausible dashboard, navigate to your site's settings.
222+
3. Go to the "Site Installation" section and click "Review Installation" to get your unique tracking snippet.
223+
4. Copy the complete script snippet provided by Plausible from your dashboard.
224+
5. Add it to your `_quarto.yml` configuration file under the `plausible-analytics` key:
225+
226+
For example, it could look like this, where `pa-XXXXXX.js` would be your own custom script provided by Plausible:
227+
228+
``` yaml
229+
website:
230+
plausible-analytics: |
231+
<script async src="https://plausible.io/js/pa-XXXXXX.js"></script>
232+
<script>
233+
window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};
234+
plausible.init()
235+
</script>
236+
```
237+
238+
The script will automatically be included in the `<head>` of every page on your website. **Important:** Make sure to copy and paste the complete snippet exactly as provided by Plausible - the example above shows the typical structure, but your actual snippet will have a unique tracking code instead of `XXXXXX`.
239+
240+
::: {.callout-tip}
241+
The snippet from your Plausible dashboard may include multiple `<script>` tags and initialization code. Copy the entire snippet as-is - don't modify or simplify it.
242+
:::
243+
244+
### Optional Enhanced Measurements
245+
246+
Plausible offers optional enhanced measurements that you can enable directly in your site settings dashboard (such as outbound link tracking, file downloads, etc.). When you enable these features in Plausible, your tracking snippet will be automatically updated in your dashboard. Simply copy the updated snippet and replace it in your `_quarto.yml` configuration.
247+
248+
For more information about available enhanced measurements and configuration options, see the [Plausible script documentation](https://plausible.io/docs/plausible-script).
249+
250+
### Privacy Benefits
251+
252+
Unlike traditional analytics solutions, Plausible Analytics:
253+
254+
- **No cookies**: Plausible doesn't use cookies or generate any persistent identifiers, so no cookie consent banners are needed
255+
- **GDPR compliant**: All visitor data is anonymized and processed in the EU
256+
- **Lightweight**: The script is under 1 KB, significantly smaller than Google Analytics
257+
- **No cross-site tracking**: Plausible doesn't track users across different websites
258+
259+
Because Plausible is privacy-friendly by default, you typically don't need to implement [Cookie Consent] when using it (though you should verify this with your own privacy requirements).
260+
214261
## Google Analytics
215262

216263
You can add [Google Analytics](https://analytics.google.com/) to your website by adding a `google-analytics` key to your `_quarto.yml` file. In its simplest form, you can just pass your Google Analytics tracking Id (e.g. `UA-xxxxxxx`) or Google Tag measurement Id (e.g. `G-xxxxxxx`) like:

0 commit comments

Comments
 (0)